[HELP] What's wrong? Please help me !!! - 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: [HELP] What's wrong? Please help me !!! (
/showthread.php?tid=154433)
[HELP] What's wrong? Please help me !!! -
sebytzu - 13.06.2010
Код:
if(strcmp(cmd, "/command", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /command [playerid/PartOfName] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 3)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /command [playerid/PartOfName] [reason]");
return 1;
}
PlayerInfo[giveplayerid][pLevel] = -999;
Ban(giveplayerid);
return 1;
}
format(string, sizeof(string), "...: %s", (result));
SendClientMessage(giveplayerid, COLOR_WHITE, string);
}//not connected
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
I got 6 errors : error 006: must be assigned to an array
error 035: argument type mismatch (argument 1)
error 012: invalid function call, not a valid address
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Re: [HELP] What's wrong? -
knopke - 13.06.2010
Код:
if(strcmp(cmd, "/command", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /command [playerid/PartOfName] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 3)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /command [playerid/PartOfName] [reason]");
return 1;
}
PlayerInfo[giveplayerid][pLevel] = -999;
Ban(giveplayerid);
return 1;
}
format(string, sizeof(string), "...: %s", (result));
SendClientMessage(giveplayerid, COLOR_WHITE, string);
}//not connected
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
}
}
return 1;
}