22.07.2012, 04:49
Quote:
I need a command like /slap [ID] but this one also lets you decide how high up you slap them.
|
pawn Код:
CMD:slap(playerid,params[])
{
new targetid,height;
if(sscanf(params,"uI(10)",targetid,height)) return SendClientMessage(playerid,-1,"USAGE : /slap [id] [height]");
if(!IsPlayerConnected(targetid) || targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"Player not connected || Invalid Id");
new Float:pos[3];
GetPlayerPos(targetid,pos[0],pos[1],pos[2]);
SetPlayerPos(targetid,pos[0],pos[1],pos[2] + height);
new msg[128];
new pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,24);
GetPlayerName(targetid,tName,24);
format(msg,sizeof(msg),"%s(%d) slapped %s(%d)",pName,playerid,tName,targetid);
SendClientMessageToAll(-1,msg);
return 1;
}
Height is optional.
If you do /slap 0, it will set player height 10.
* [MM]RoXoR[FS] slaps 0 2 , it will set player height to 2. around a bit with a large trout.