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; }
if(sscanf(params, "uz", targetid)) |
if(sscanf(params, "uz", targetid))
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command.");
if(PlayerInfo[playerid][pAdmin] == 0) return 0;
pawn Code:
pawn Code:
pawn Code:
|
if(PlayerInfo[playerid][pAdmin] == 0) return 0;
new name[128];
GetPlayerName(targetid, name, sizeof(name));
dcmd_slap( playerid, params[ ] )
{
if( PlayerInfo[ playerid ][ pAdmin ] == 0 ) return SendClientMessage( playerid,COLOR_WHITE,"SERVER: Unknown command." );
new targetid;
if( sscanf( params, "r", targetid ) ) return SendClientMessage( playerid, COLOR_WHITE, "{FFFFFF}[{FF0000}USAGE{FFFFFF}]{EFF7FF} /slap <playerid>" );
if( targetid == INVALID_PLAYER_ID ) return SendClientMessage( playerid, COLOR_WHITE, "{FFFFFF}[{FF0000}ERROR{FFFFFF}]{EFF7FF} Inactive player." );
new Float:SLX, Float:SLY, Float:SLZ;
GetPlayerPos( targetid, SLX, SLY, SLZ );
SetPlayerPos( targetid, SLX, SLY, SLZ + 10 );
return 1;
}
pawn Code:
|
dcmd_slap( playerid, params[ ] ) { if( PlayerInfo[ playerid ][ pAdmin ] == 0 ) return 0; new targetid = -1; if( sscanf( params, "u", targetid ) ) return SendClientMessage( playerid, COLOR_WHITE, "[{FF0000}USAGE{FFFFFF}]{EFF7FF} /slap <playerid>" ); if( !IsPlayerConnected( targetid ) ) return SendClientMessage( playerid, COLOR_WHITE, "[{FF0000}USAGE{FFFFFF}]{EFF7FF} /slap <playerid>" ); new Float:SLX, Float:SLY, Float:SLZ; GetPlayerPos( targetid, SLX, SLY, SLZ ); SetPlayerPos( targetid, SLX, SLY, SLZ + 10 ); return 1; }
Use sscanf plugin, not the pawno version.
Try this: Code:
dcmd_slap( playerid, params[ ] ) { if( PlayerInfo[ playerid ][ pAdmin ] == 0 ) return 0; new targetid = -1; if( sscanf( params, "u", targetid ) ) return SendClientMessage( playerid, COLOR_WHITE, "[{FF0000}USAGE{FFFFFF}]{EFF7FF} /slap <playerid>" ); if( !IsPlayerConnected( targetid ) ) return SendClientMessage( playerid, COLOR_WHITE, "[{FF0000}USAGE{FFFFFF}]{EFF7FF} /slap <playerid>" ); new Float:SLX, Float:SLY, Float:SLZ; GetPlayerPos( targetid, SLX, SLY, SLZ ); SetPlayerPos( targetid, SLX, SLY, SLZ + 10 ); return 1; } |
I'm using plugin version already. And still slapping myself. What kind of problem is this :/
|