Need /slap [ID] [how high you go when slapped]
#8

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
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;
}
You will need sscanf2 and ZCMD.

Height is optional.
If you do /slap 0, it will set player height 10.
* Kindred slaps 0 2 , it will set player height to 2. around a bit with a large trout.
Waste of lines, you can easily make every single new in one line, and it would look neater.

Код:
!IsPlayerConnected(targetid) || targetid == INVALID_PLAYER_ID
Doesn't this mean EXACTLY the same thing? If the player is not connected, it is an invalid player id.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)