/slap error/warning +rep
#1

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
Reply
#2

*if(IsPlayerAnAdmin(i))
Reply
#3

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
Reply
#4

The IsPlayerAnAdmin, send the code to view.
Reply
#5

Quote:
Originally Posted by pabloalber84
Посмотреть сообщение
The IsPlayerAnAdmin, send the code to view.
Код:
stock IsPlayerAnAdmin(playerid,Rang)
{
	if(GetPVarInt(playerid,"Admins")>=Rang)
	return 1;
}
Reply
#6

Try this :/
Quote:

stock IsPlayerAnAdmin(playerid,Rang)
{
if(GetPVarInt(playerid,"Admins")>=Rang){return 1;}
else{return 0;}
}

Reply
#7

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
Reply
#8

Please show me the line 589.
Reply
#9

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
Reply
#10

new name[MAX_PLAYER_NAME];
name = GetPLayerName(playerid);
format(string,sizeof(string),"You've slapped %s", name);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)