what is 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: what is this ?!?!?!? (
/showthread.php?tid=157719)
what is this ?!?!?!? -
iJumbo - 07.07.2010
pawn Код:
Pawn compiler 3.2.3664 Copyright (C) 1997-2006, ITB CompuPhase
Header size: 3328 bytes
Code size: 121720 bytes
Data size: 84952 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 226384 bytes
what is this
help plz
Re: what is this ?!?!?!? -
MadeMan - 07.07.2010
It is a warning. What did you add to your script when this came up?
Re: what is this ?!?!?!? -
iJumbo - 07.07.2010
i put a command and a stock
i show the script
THE STOCK
pawn Код:
stock strrest(const str[], &index)
{
new length = strlen(str);
while ((index < length) && (str[index] <= ' '))
{
index++;
}
new offset = index;
new result[128];
while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = str[index];
index++;
}
result[index - offset] = EOS;
return result;
}
THE COMMAND
pawn Код:
if (strcmp("/playerban", cmdtext, true, 10) == 0)//Solo per admin//if(IsPlayerAdmin(playerid) == 1)
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, 0xEB000FFF, "ERRORE: Devi essere loggato per usare questo comando");
if(level[playerid] >= 5)
{
new playername[MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME];
//new pip[MAX_PLAYER_NAME];
new pid;
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,0xFF8A00AA,"Utilizzo: /playerban [playerid][motivo]");
return 1;
}
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage)) {
SendClientMessage(playerid,COLOR_ROSSO,"Non hai messo un motivo (Obbligatorio)");
return 1;
}
pid = strval(tmp);
if(!IsPlayerConnected(pid))
{
SendClientMessage(playerid,0xEB000FFF,"Questo giocatore non e' connesso");
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
return 1;
}
if(IsPlayerAdmin(pid) == 1)
{
SendClientMessage(playerid,0xEB000FFF,"Non puoi bannare questo admin perche e di livello superiore");
PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
return 1;
}
new string[256];
GetPlayerName(pid,playername,sizeof(playername));
GetPlayerName(playerid,name, sizeof(name));
//GetPlayerIp(pid, pip, sizeof(pip));
format(string,sizeof(string),"SERVER: %s has been banned from the server by administrator %s .(Motivo: %s )",playername,name,gMessage);
SendClientMessageToAll(0xFFFF00AA,string);
SendClientMessage(pid,0xEB000FFF,"Sei stato bannato dal server!!");
//printf("[BAN] %s has been banned by %s (IP:%s)",playername, name, pip);
Ban(pid);
return 1;
} else return SendClientMessage(playerid,0xEB000FFF,"ERRORE:Devi essere un admin liv 5 per usare questo comando"),PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
}
Re: what is this ?!?!?!? -
Hiddos - 07.07.2010
****** made a topic about it once why you shouldn't use 256 cell sized strings.
And I'll remember some things forever;
1) The max input for SA-MP (By Chat) is 128.
2) The max chat output for SA-MP is also 128.
So, if you'd make a [256] string, you'd have 128 cells that would never be used.
Re: what is this ?!?!?!? -
iJumbo - 07.07.2010
okay im go to test it
sorry bad english