SA-MP Forums

Go Back   SA-MP Forums > Search Forums

Showing results 1 to 25 of 500
Search took 0.02 seconds.
Search: Posts Made By: Kwarde
Forum: Scripting Help 27/05/2020, 09:14 PM
Replies: 8
Views: 206
Posted By Kwarde
Re: Discord DCC_GetRoleName

Are you sure that there are no more "break"s in the "My actions" part?
The second example should absolutely not be done. break stops a loop and proceeds to code after the loop. If we take this...
Forum: Scripting Help 27/05/2020, 10:29 AM
Replies: 8
Views: 206
Posted By Kwarde
Re: Discord DCC_GetRoleName

DCC_GetGuildMemberRoleCount(guild, author, roleCount);
if(channel == g_Discord_Admin_CMD) {
if(!strcmp(command, "!mycommand", true)) {
//Loop through all roles for this user
...
Forum: Scripting Help 26/05/2020, 10:22 AM
Replies: 4
Views: 95
Posted By Kwarde
Re: can i do this? (||)

Nope.
Tip: Create a filterscript and create a similar code to test it if you wanna know something like this. Example:


#include <a_samp>

enum
{
Role1 = 1,
Role2,
Forum: Gamemode Scripts 25/05/2020, 08:41 PM
Replies: 144
Views: 30,616
Posted By Kwarde
Re: San Fierro Cops And Robbers

https://github.com/Whitetigerswt/SAMP_AC_v2 ?
Forum: Scripting Help 24/05/2020, 09:58 PM
Replies: 7
Views: 97
Posted By Kwarde
Re: Error 022: must be lvalue (non-constant)

1) https://wiki.sa-mp.com/wiki/Strtok :


2) You should use something like Y_COMMANDS or Pawn.CMD instead of dcmd, it's highly outdated aswell

3) You should use something like Y_INI or MySQL...
Forum: Scripting Help 21/05/2020, 02:10 PM
Replies: 14
Views: 393
Posted By Kwarde
Re: I need a working detection of country script

Nope.
Might wanna read this article: https://www.comparitech.com/blog/vpn-privacy/how-easy-is-it-to-detect-a-vpn/

To sum everything up from that article (it's literally a quote of it)
Forum: Scripting Help 21/05/2020, 12:33 PM
Replies: 14
Views: 393
Posted By Kwarde
Re: I need a working detection of country script

https://wiki.sa-mp.com/wiki/HTTP ;

HTTP_ERROR_BAD_HOST 1
HTTP_ERROR_NO_SOCKET 2
HTTP_ERROR_CANT_CONNECT 3
HTTP_ERROR_CANT_WRITE 4
HTTP_ERROR_CONTENT_TOO_BIG 5...
Forum: Scripting Help 21/05/2020, 02:53 AM
Replies: 4
Views: 137
Posted By Kwarde
Re: warning 239: literal array/string passed to a non-const parameter

Use this on top of your script:
#pragma warning disable 214,239

Alternatively you can run pawncc with option -w (disables specific warning(s))
Forum: Scripting Help 20/05/2020, 05:11 PM
Replies: 2
Views: 85
Posted By Kwarde
Re: I cant compile !!

It seems core.inc (default include that comes with the SAMP server package) was modified.
Line 12 is "native heapspace();" -Something went wrong there and thus heapspace() was never declared (hence...
Forum: Scripting Help 20/05/2020, 04:55 PM
Replies: 14
Views: 393
Posted By Kwarde
Re: I need a working detection of country script

This whole thing can be done so much easier:


//Get IP and send that data:
new string[45];
GetPlayerIp(playerid, string, 16);
format(string, sizeof(string), "ip-api.com/csv/%s?fields=3",...
Forum: Scripting Help 20/05/2020, 02:22 PM
Replies: 3
Views: 127
Posted By Kwarde
Re: dini to mysql

Sidenote: It is possible but only with constant values, eg.


new myArray[] = "Hello world!", otherArray[] = "Hello other world!";
otherArray = myArray;
//Now both arrays will print "Hello...
Forum: Filterscripts 17/05/2020, 09:04 PM
Replies: 4,018
Views: 2,219,419
Posted By Kwarde
Re: Useful Functions

Couldn't find a function for this so figured I created one: similar_hexes.
It compares two hex colors (in 0xRRGGBB format, not any other format such as 0xRRGGBBAA or 0xAARRGGBB) and decides if they...
Forum: Scripting Help 17/05/2020, 06:29 PM
Replies: 4
Views: 84
Posted By Kwarde
Re: Need a Little Help

TIP: Whenever you're getting a "number of arguments does not match definition" warning, go to SAMP's Wiki page (if it's a native SAMP function). --"number of arguments does not match definition"...
Forum: Scripting Help 17/05/2020, 04:20 PM
Replies: 9
Views: 137
Posted By Kwarde
Re: [Help] Beginner Help

That big pdf is the official pawn language guide from the creators of the language. If you really want to learn pawn, that is the perfect document to start with.
Forum: Scripting Help 17/05/2020, 03:33 PM
Replies: 9
Views: 137
Posted By Kwarde
Re: [Help] Beginner Help

%s and %d are format specifiers. s for strings, d for decimals, i for integers, f for floats etcetera.
More information on format() and the format specifiers here: https://wiki.sa-mp.com/wiki/Format...
Forum: Scripting Help 17/05/2020, 01:11 PM
Replies: 9
Views: 137
Posted By Kwarde
Re: [Help] Beginner Help

First of all, the language is Pawn and not pawno (pawno is an editor, which uses pawncc as compiler).

You may want to start with this one:...
Forum: Screenshots and Videos 15/05/2020, 08:51 PM
Replies: 6
Views: 420
Posted By Kwarde
Re: [MAPS] RANDOM OLD MAPS (FLASHBACK FRIDAY)

That's pretty nice indeed! Also, Ezio <3
Forum: Scripting Help 15/05/2020, 08:29 PM
Replies: 16
Views: 257
Posted By Kwarde
Re: error 047: array sizes do not match, or destination array is too small

This is only possible with literal or pre-defined strings.


new helloWorld[] = "Hey there cruel world!", myWorld[] = "This is my world!";

main()
{
helloWorld = "Hello world!"; //Valid
...
Forum: Scripting Help 15/05/2020, 08:19 PM
Replies: 3
Views: 76
Posted By Kwarde
Re: Help with kick command

That is usually correct. However, note that the "u" specificier in sscanf() returns INVALID_PLAYER_ID if the player is not connected. Otherwise it returns the ID of the first found player.
Forum: Scripting Help 15/05/2020, 08:07 PM
Replies: 7
Views: 111
Posted By Kwarde
Re: OnPlayerCommandPerformed

Yes. You will need Pawn.CMD tho.
And using above example, all you need to do is to add this line in your script to make the command unusable during duel:
flags:COMMAND_NAME(NO_USE_DUEL);
...
Forum: Scripting Help 15/05/2020, 07:57 PM
Replies: 7
Views: 111
Posted By Kwarde
Re: OnPlayerCommandPerformed

Ignore what GameOvr said. If there's a shitload of commands you'd compare for alot of strings which is pretty bad practice. For example, you want admins to be able to use admin commands in case...
Forum: Scripting Help 15/05/2020, 07:43 PM
Replies: 7
Views: 111
Posted By Kwarde
Re: OnPlayerCommandPerformed

You should consider using flags. These are easy to use at Pawn.CMD
Forum: Scripting Help 14/05/2020, 04:51 PM
Replies: 5
Views: 137
Posted By Kwarde
Re: Doubt with Mysql and Samp

Even though your code wouldn't compile, yes:

new newload[10][32];
newload[0] = "This,is,a,string";
sscanf(newload[0], "p<,>s[32]s[32]s[32]s[32]", newload[0], newload[1], newload[2], newload[3]);...
Forum: Scripting Help 14/05/2020, 01:16 PM
Replies: 5
Views: 137
Posted By Kwarde
Re: Doubt with Mysql and Samp

Here is more information on how to use sscanf:
https://forum.sa-mp.com/showthread.php?t=570927
Forum: Scripting Help 13/05/2020, 05:45 PM
Replies: 2
Views: 81
Posted By Kwarde
Re: Help me with errors!

There is so much wrong in that code. You should really consider start learning scripting basics. (Not even PAWN basics, just scripting basics).
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 12:43 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.