Cmd not working [+rep]
#1

Well this command ain't working...

Код HTML:
if (strcmp("/deliver", cmdtext, true) == 0)
    {
        new vehicle;
		vehicle = GetPlayerVehicleID(playerid);
        if(vehicle > Missioncar)
        {
	        if(!IsPlayerInRangeOfPoint(playerid, 20.0, -2329.4565,2299.1106,3.5000))
	        {
				SendClientMessage(playerid, COLOR_RED, "<!>You are not near the dropoff point!");
				return 1;
			}
			GivePlayerMoney(playerid, 500);
			SetPlayerHealth(playerid, 100);
			SetPlayerArmour(playerid, 100);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Mission done! You have been awarded!");
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have received 100HP, 100Armour and 500$!");
			DestroyVehicle(Missioncar);
			SendClientMessageToAll(COLOR_BLUE, "<!>Mission is done! USA did it!");
			return 1;
		}
		return 1;
	}
Anyone knows why?
Reply
#2

pawn Код:
if (strcmp("/deliver", cmdtext, true) == 0)
    {
        new vehicle;
        vehicle = GetPlayerVehicleID(playerid);
        if(vehicle == Missioncar)
        {
            if(!IsPlayerInRangeOfPoint(playerid, 20.0, -2329.4565,2299.1106,3.5000))
            {
                SendClientMessage(playerid, COLOR_RED, "<!>You are not near the dropoff point!");
                return 1;
            }
            GivePlayerMoney(playerid, 500);
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 100);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Mission done! You have been awarded!");
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have received 100HP, 100Armour and 500$!");
            DestroyVehicle(Missioncar);
            SendClientMessageToAll(COLOR_BLUE, "<!>Mission is done! USA did it!");
            return 1;
        }
        return 1;
    }
What are you actually trying to make? Please explain more
Reply
#3

Well if the player is in the MissionCar he should be abble to do that /deliver if he's near -2329.4565,2299.1106,3.5000

Well I made a mission now I just need /deliver command.

If player is in the deliver car and in range of that point he will be abble to do /deliver, which will give him the stats that I added there and his car (MissionCar) will be destroyed
Reply
#4

ok for your mission car make it as
pawn Код:
new Missioncar[MAX_PLAYERS];
on top and
command
pawn Код:
if (strcmp("/deliver", cmdtext, true) == 0)
    {
        new vehicle;
        vehicle = GetPlayerVehicleID(playerid);
        if(vehicle == Missioncar[playerid])
        {
            if(!IsPlayerInRangeOfPoint(playerid, 20.0, -2329.4565,2299.1106,3.5000))
            {
                SendClientMessage(playerid, COLOR_RED, "<!>You are not near the dropoff point!");
                return 1;
            }
            GivePlayerMoney(playerid, 500);
            SetPlayerHealth(playerid, 100);
            SetPlayerArmour(playerid, 100);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>Mission done! You have been awarded!");
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "<!>You have received 100HP, 100Armour and 500$!");
            DestroyVehicle(Missioncar[playerid]);
            SendClientMessageToAll(COLOR_BLUE, "<!>Mission is done! USA did it!");
            return 1;
        }
        return 1;
    }
and also add under onplayerstate
pawn Код:
if(GetPlayerState(playerid) == 2)
{
        new vehicle;
        vehicle = GetPlayerVehicleID(playerid);
        if(vehicle == Missioncar[playerid]) return Missioncar[playerid] = 1;
}
idk if this will work
Reply
#5

Thanks
Reply
#6

repp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)