/slap command help
#10

More problems, I am trying to make it so i can not slap over 100 meters but yet it slaps me then gives me the message about it.

code
Код:
CMD:slap(playerid,params[])
{
    new string[128], playerb, height;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
 	if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
	if(PlayerInfo[playerid][pAdmin] < PlayerInfo[playerb][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you.");
    if(sscanf(params, "ui", playerb,height)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /slap [playerid] [meters]");
    if(height < 100) return SendClientMessage(playerid, COLOR_GREY, "You can not slap anyone over 100 meters.");
    new Float:pos[3];
    GetPlayerPos(playerb, pos[0], pos[1], pos[2]);
    SetPlayerPos(playerb, pos[0], pos[1], pos[2]+height);
    //if(height < 0 || height > 100) return SendClientMessage(playerid, COLOR_GREY, "You can not slap anyone over 100.");
    format(string,sizeof(string),"AdmWarn: %s has slapped %s, they were slapped %d meters high.", RPN(playerid), RPN(playerid), height);
    SendAdminMessage(COLOR_LIGHTRED, 1, string);
    return 1;
}
Help me once more plz haha
Reply


Messages In This Thread
/slap command help - by MichaelWharton101 - 10.04.2013, 23:30
Re: /slap command help - by Scenario - 10.04.2013, 23:31
Re: /slap command help - by MichaelWharton101 - 10.04.2013, 23:33
Re: /slap command help - by iJumbo - 10.04.2013, 23:34
Re: /slap command help - by Pottus - 10.04.2013, 23:35
Re: /slap command help - by iJumbo - 10.04.2013, 23:46
Re: /slap command help - by Scenario - 10.04.2013, 23:59
Re: /slap command help - by iJumbo - 11.04.2013, 00:01
Re: /slap command help - by Pottus - 11.04.2013, 00:04
Re: /slap command help - by MichaelWharton101 - 11.04.2013, 00:04

Forum Jump:


Users browsing this thread: 1 Guest(s)