18.02.2012, 15:28
Hi. When I type this command for an inactive player, I'm getting slap by myself. And When I do it for an active player, he is getting slap by me so its ok. But I don't know why !IsPlayerConnected isn't working, any idea about this ?
Code:
dcmd_slap(playerid,params[]) { if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command."); new targetid; if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}[{FF0000}USAGE{FFFFFF}]{EFF7FF} /slap <playerid>"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}[{FF0000}ERROR{FFFFFF}]{EFF7FF} Inactive player."); else { new Float:SLX, Float:SLY, Float:SLZ; GetPlayerPos(targetid, SLX, SLY, SLZ); SetPlayerPos(targetid, SLX, SLY, SLZ+10); } return 1; }