/tazer
#1

For some wierd reason if I type /tazer it comes up unknown command

Код:
CMD:tazer(playerid, params[]) {

	new
		string[128],
		playerNames[2][MAX_PLAYER_NAME],
		target;

    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] != 1) {
        SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
		return 1;
    }
	target = GetClosestPlayer(playerid);
    if(groupVariables[playerVariables[target][pGroup]][gGroupType] == 1) {
        SendClientMessage(playerid, COLOR_GREY, "You can't taze other law enforcement officers.");
    }
    else {
	    if(IsPlayerInRangeOfPlayer(playerid, target, 7.5)) {
            if(playerVariables[target][pFreezeType] == 0 || playerVariables[target][pFreezeType] == 5) {
                if(!IsPlayerInAnyVehicle(target)) {

					GetPlayerName(playerid, playerNames[0], MAX_PLAYER_NAME);
					GetPlayerName(target, playerNames[1], MAX_PLAYER_NAME);

    				TogglePlayerControllable(target, 0);
    				playerVariables[target][pFreezeTime] = 15;
					playerVariables[target][pFreezeType] = 1;
					PlayerPlaySound(target, 1085, 0.0, 0.0, 0.0);
    	    		GameTextForPlayer(target,"~n~~r~Tazed!",4000,4);

    	    		format(string, sizeof(string), "* %s fires their tazer at %s, stunning them.", playerNames[0], playerNames[1]);
    	    		nearByMessage(playerid, COLOR_PURPLE, string);
					format(string, sizeof(string),"You have successfully stunned %s.", playerNames[1]);
					SendClientMessage(playerid, COLOR_NICESKY, string);
					PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
					ApplyAnimation(target,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
    	    	}
    	    	else SendClientMessage(playerid, COLOR_GREY, "You can't taze someone who is inside a vehicle.");
    	    }
    	    else SendClientMessage(playerid, COLOR_GREY, "That person has already been cuffed, stunned, or frozen.");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Nobody is in range.");
	}
	return 1;
}
Reply


Messages In This Thread
/tazer - by Jordiee - 23.11.2011, 17:37
Re: /tazer - by Jordiee - 23.11.2011, 17:53
Re: /tazer - by Pharrel - 23.11.2011, 17:56
Re: /tazer - by Jordiee - 23.11.2011, 18:02

Forum Jump:


Users browsing this thread: 1 Guest(s)