/slap error/warning +rep -
ItzRbj - 22.06.2015
Script
Код:
ocmd:slap(playerid,params[])
{
if(!IsPlayerAnAdmin(playerid,2))return SendClientMessage(playerid,COLOR_BLUE,"You're not allowed to use this command");
new string[128], string2[128];
format(string,sizeof(string),"You've slapped %s", PlayerName);//Line 589
format(string2,sizeof(string2),"You've been slapped by Adminstrator");
for(new i=0;i<GetMaxPlayers();i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAnAdmin(i,1))
{
format(string2,sizeof(string2),"A: %s [LEVEL %i] used the SLAP command.",PlayerName(playerid),GetPVarInt(playerid,"Admin"));
SendClientMessage(i,COLOR_ORANGE,string2);
}
}
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+10);
return 1;
}
error/warning
Код:
(589) : error 076: syntax error in the expression, or invalid function call
(872) : warning 209: function "IsPlayerAnAdmin" should return a value
Respuesta: /slap error/warning +rep -
pabloalber84 - 22.06.2015
*if(IsPlayerAnAdmin(i))
Re: Respuesta: /slap error/warning +rep -
ItzRbj - 22.06.2015
Quote:
Originally Posted by pabloalber84
*if(IsPlayerAnAdmin(i))
|
the (playerid,2) after it means i dont want admins less than lvl 2 to use this cmd
Respuesta: /slap error/warning +rep -
pabloalber84 - 22.06.2015
The IsPlayerAnAdmin, send the code to view.
Re: Respuesta: /slap error/warning +rep -
ItzRbj - 22.06.2015
Quote:
Originally Posted by pabloalber84
The IsPlayerAnAdmin, send the code to view.
|
Код:
stock IsPlayerAnAdmin(playerid,Rang)
{
if(GetPVarInt(playerid,"Admins")>=Rang)
return 1;
}
Re: /slap error/warning +rep -
Neos07 - 22.06.2015
Try this :/
Quote:
stock IsPlayerAnAdmin(playerid,Rang)
{
if(GetPVarInt(playerid,"Admins")>=Rang){return 1;}
else{return 0;}
}
|
Re: /slap error/warning +rep -
ItzRbj - 22.06.2015
Quote:
Originally Posted by Neos07
Try this :/
|
The warning is solved but the error is still there
Код:
(589) : error 076: syntax error in the expression, or invalid function call
Re: /slap error/warning +rep -
Neos07 - 22.06.2015
Please show me the line 589.
Re: /slap error/warning +rep -
ItzRbj - 22.06.2015
Quote:
Originally Posted by Neos07
Please show me the line 589.
|
Код:
format(string,sizeof(string),"You've slapped %s", PlayerName);
btw the whole cmd is up there on the thread
Re: /slap error/warning +rep -
Neos07 - 22.06.2015
new name[MAX_PLAYER_NAME];
name = GetPLayerName(playerid);
format(string,sizeof(string),"You've slapped %s", name);