09.06.2014, 12:59
Alright,
Let's script a slap command:
I hope I helped you, your friend Jameel, you could've asked in skype anyway!
Let's script a slap command:
pawn Код:
CMD:slap(playerid, params[])
{
new playa, string[128];
if(sscanf(params,"u",playa)) // I guess that you know what SSCANF does, in one word we can sum up and say RESTRICTIONS!.
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /slap [playerid/PartOfName]");
return 1;
}
if(pInfo[playerid][AdminLevel] >= 2) // this means IF the admin level EQUALS to (2) or MORE he can do this ACTION.
{
if(IsPlayerConnected(playa)) // Checking if the player that we're slapping is even online
{
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playa, slx, sly, slz); // getting his current position
SetPlayerPos(playa, slx, sly, slz+5); // slapping him up (increased Z's according to his previous coordinates)
PlayerPlaySound(playa, 1130, slx, sly, slz+5); // played some sound.
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); // if the admin level doesn't equals to 2 or more then send this message ONLY
}
return 1;
}

