23.05.2009, 20:06
Okay, as I know 256 is not higly recommended, so I tryed to use 128, but I get :
Command:
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?
Код:
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
Код:
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;
}

