31.07.2011, 05:11
So Like this?
Now it won't show the "Player is not Connected" message.
pawn Code:
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "i", playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /slap [playerid]"); // Checking is the player just typed /slap now e.g. /slap 0 10
if(IsPlayerConnected(playerid))
{
format(string, sizeof(string), "%s has slapped %s",pName,vName); // Defining string
SendClientMessageToAll(COLOR_ORANGE, string);
GetPlayerPos(playerid, x,y,z);
SetPlayerPos(playerid,x,y,z+15);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE,"Player is not connected");
}
}