SA-MP Forums Archive
Whats this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Whats this? (/showthread.php?tid=169291)



Whats this? - willsuckformoney - 19.08.2010

This

Код:
Header size:           1716 bytes
Code size:            25268 bytes
Data size:            25944 bytes
Stack/heap size:      16384 bytes; estimated max. usage=5064 cells (20256 bytes)
Total requirements:   69312 bytes
Got that on compile, never got before, anyone know what it is?


Re: Whats this? - CJ101 - 19.08.2010

You are using too much cells... Ex 256. Try not to use 256 in strings all the time.


Re: Whats this? - willsuckformoney - 19.08.2010

oh had like 10 of them... What should i replace them with?

EDIT: What is used before 256 158? or something like that^


Re: Whats this? - CJ101 - 19.08.2010

Try using 128.


Re: Whats this? - willsuckformoney - 19.08.2010

ok lets test

EDIT: I Get this

Код:
error 047: array sizes do not match, or destination array is too small
two times these are the lines

pawn Код:
tmp = strtok(cmdtext, idx);
but i have only one 256 string, 256 needed for

pawn Код:
new cmd[256], string[128], tmp[256], idx;
    cmd = strtok(cmdtext, idx);
anything about that? it gives me this but compiles no errors or warnings

Код:
awn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           1716 bytes
Code size:            25268 bytes
Data size:            25940 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4808 cells (19232 bytes)
Total requirements:   69308 bytes



Re: Whats this? - PotH3Ad - 19.08.2010

You should convert to sscanf + zcmd.


Re: Whats this? - willsuckformoney - 19.08.2010

D: I Don't know how to change strcmp to zcmd or sscanf D:


Re: Whats this? - PotH3Ad - 19.08.2010

Here is a quick example, hopefully it helps you understand how to use zcmd & sscanf somewhat... (I'm not so good at explaining things :P)

pawn Код:
CMD:hey(playerid, params[])
{
    new target; //We will store the player in this variable

    //The sscanf line will store the targets's id/name the user entered.
    //If "params" are null (empty), then return a error message to the player...
    if(sscanf(params, "u", target)) return SendClientMessage(playerid, 0xFAFAFAFA, "USAGE: /hey <playerid/name>");

    //If the player is not connected or is invalid, return and error msg
    else if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFAFAFAFA, "Player not connected or found!");
   
    new str[80];
    format(str, sizeof(str), "%s said hey to you...", pName(playerid));
    //Send the message to the target...
    SendClientMessage(target, 0xFAFAFAFA, str);
    return 1;
}



Re: Whats this? - willsuckformoney - 19.08.2010

lol not really that simple... its a tempban.. not a /hey


Re: Whats this? - Zeex - 19.08.2010

Try #pragma dynamic 6000