Cells - 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: Cells (
/showthread.php?tid=78877)
Cells -
Hot - 23.05.2009
Okay, as I know 256 is not higly recommended, so I tryed to use 128, but I get :
Код:
C:\Documents and Settings\Convidado\Meus documentos\MedicDCMD.pwn(109) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\Convidado\Meus documentos\MedicDCMD.pwn(109) : error 047: array sizes do not match, or destination array is too small
Command:
Код:
new index, cmd[256], tmp[256], id;
cmd = strtok(cmdtext, index);
if (strcmp(cmd, "/heal", true) == 0)
{
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SetPlayerHealth(id, 100.0);
SendClientMessage(id, 0x00FF00AA, "You have been healed");
SendClientMessage(playerid, 0x00FF00AA, "Player healed");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
}
return 1;
}
On my Gamemode, it has registration and login system so it includes dudb and dini, so the strtok is already included. How could I set my command to allow 128 cells?
Re: Cells -
Klutty - 23.05.2009
Just read the error it explains it, try like 200 or w/e.
Re: Cells -
Hot - 23.05.2009
Nope, do you think doesn't tried it? -.-
Re: Cells -
Klutty - 23.05.2009
Well - sorry for trying to help.
Re: Cells -
.::: Ecko :::. - 23.05.2009
Nothing wrong whit the code..I compiled and no errors..
Ecko
Re: Cells -
Hot - 23.05.2009
because the cells are 256, try 128 then you get the errors. cmd[
256]
Re: Cells -
Hot - 23.05.2009
Help? please it's really important ...
Re: Cells -
.::: Ecko :::. - 23.05.2009
Quote:
Originally Posted by Hot
because the cells are 256, try 128 then you get the errors. cmd[256]
|
Well there is the problem..the error is saying the same as you do... ---> array is too small !
just leave the 256!
Ecko
Re: Cells -
Weirdosport - 23.05.2009
If you read the error, it says the array sizes don't match.
Re: Cells -
Nero_3D - 23.05.2009
Quote:
Originally Posted by Weirdosport
If you read the error, it says the array sizes don't match.
|
I think that didnt help :S
Your strtok uses 256 cells which is a total waste
Just use that strtok =>
https://sampwiki.blast.hk/wiki/Strtok