Simplest error and I can't fix it... - 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: Simplest error and I can't fix it... (
/showthread.php?tid=244254)
Simplest error and I can't fix it... -
grand.Theft.Otto - 26.03.2011
pawn Код:
dcmd_annoy(playerid,params[])
{
#pragma unused params
if(PlayerInfo[playerid][LoggedIn] == 1)
{
if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
{
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /annoy [playerid] [reason]");
new player1, playername[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(IsPlayerConnected(player1)) return SendClientMessage(playerid,red,"Player not connected.");
if(cow_victim != -1) return SendClientMessage(playerid,red,"Sorry! It seems like your cow has already been stolen by another administrator.");
#if ALLOW_ANNOY == false
return SendClientMessage(playerid,red,"Sorry! This feature has been disabled.");
#else
AnnoyPlayer(player1);
format(string, sizeof(string),"**COW: %s (%d) (ADMIN COW) %s ",playername, player1, params[2]); SendClientMessageToAll(COLOR_PINK,string);
SendClientMessage(playerid,red,"You have released the cow.");
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /annoy [playerid] [reason]");
player1 = strval(tmp);
#endif
}
else
{
new playername[MAX_PLAYER_NAME],player1, string[128];
format(string,sizeof(string),"**COW: %s (%d) (ADMIN COW) No Reason Given.",playername,player1,params[2]); SendClientMessageToAll(COLOR_PINK,string);
return SendClientMessage(playerid,red,"You have released the cow.");
} else return SendClientMessage(playerid,red,"You Are Not Authorized To Use That Command.");
} else return SendClientMessage(playerid,red,"ERROR: You Are Not A High Enough Level To Use This Command.");
}
Here are the errors:
pawn Код:
C:\Documents and Settings\User\Desktop\Las Venturas True Crime\gamemodes\ladmin.pwn(9909) : error 029: invalid expression, assumed zero
C:\Documents and Settings\User\Desktop\Las Venturas True Crime\gamemodes\ladmin.pwn(9909) : error 001: expected token: ";", but found "return"
Line 9909
pawn Код:
} else return SendClientMessage(playerid,red,"You Are Not Authorized To Use That Command.");
Re: Simplest error and I can't fix it... -
Hashski - 26.03.2011
Edit: Gimme 2 seconds
Re: Simplest error and I can't fix it... -
Stigg - 26.03.2011
You missed ';' on your error line. Thats all.
Re: Simplest error and I can't fix it... -
grand.Theft.Otto - 26.03.2011
No, I have ; on every line close to 9909 and where it is needed, but still has the error.
Re: Simplest error and I can't fix it... -
-Rebel Son- - 26.03.2011
Код:
dcmd_annoy(playerid,params[]){ #pragma unused params if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /annoy [playerid] [reason]"); new player1, playername[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp); if(IsPlayerConnected(player1)) return SendClientMessage(playerid,red,"Player not connected."); if(cow_victim != -1) return SendClientMessage(playerid,red,"Sorry! It seems like your cow has already been stolen by another administrator."); #if ALLOW_ANNOY == false return SendClientMessage(playerid,red,"Sorry! This feature has been disabled."); #else AnnoyPlayer(player1); format(string, sizeof(string),"**COW: %s (%d) (ADMIN COW) %s ",playername, player1, params[2]); SendClientMessageToAll(COLOR_PINK,string); SendClientMessage(playerid,red,"You have released the cow."); if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /annoy [playerid] [reason]"); player1 = strval(tmp); #endif } else { new playername[MAX_PLAYER_NAME],player1, string[128]; format(string,sizeof(string),"**COW: %s (%d) (ADMIN COW) No Reason Given.",playername,player1,params[2]); SendClientMessageToAll(COLOR_PINK,string); return SendClientMessage(playerid,red,"You have released the cow."); } else return SendClientMessage(playerid,red,"You Are Not Authorized To Use That Command."); } else return SendClientMessage(playerid,red,"ERROR: You Are Not A High Enough Level To Use This Command.");
return 1;}