how to make a slap
#1

how to make a /slap command?
Reply
#2

Quote:

cmd_slap(playerid, params[])
{
new id, string[126], Float: PPos[3];
if(sscanf(params, "u", id))
return SendClientMessage(playerid, -1, "SYNTAX: /slap [id]");

GetPlayerPos(id, PPos[0], PPos[1], PPos[2]);
SetPlayerPos(id, PPos[0], PPos[1], PPos[2]+4);

new GetName[MAX_PLAYER_NAME]
GetPlayerName(playerid, GetName, sizeof(GetName));
format(string, sizeof(string), "You have slapped %s", GetName(id));
SendClientMessage(playerid, -1, string);
return 1;
}

There ya go!
Reply
#3

You need to retrieve their current position using GetPlayerPos.

Then you need to use their position and increase the Z coordinate by 5, then set their position using SetPlayerPos.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)