Car respawn after command
#1

What is do i need to add if he does leavemission so the truck will respawn and he will exit from the truck..


Код:
	
if(!strcmp(cmd, "/leavemission", true))
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerIsTrucking[playerid] == 1)
            {
                DisablePlayerCheckpoint(playerid);
                PlayerIsTrucking[playerid] = 0;
                SendClientMessage(playerid, COLOR_WHITE, "You have stopped your mission");
                if(IsATruck(idcar))
                {
                    RemovePlayerFromVehicle(playerid);
                    TogglePlayerControllable(playerid, 1);
                }
            }
            else
            {
		SendClientMessage(playerid, COLOR_GREY, "   You are not on any mission ! ");
                return 1;
            }
        }
        return 1;
    }
Reply
#2

pawn Код:
if(!strcmp(cmd, "/leavemission",1))
{
            if(PlayerIsTrucking[playerid] == 1)
            {
                if(IsATruck(Batz))
                {
                    DisablePlayerCheckpoint(playerid);
                    PlayerIsTrucking[playerid] = 0;
                    SendClientMessage(playerid, COLOR_WHITE, "You have stopped your mission");
                    new Batz = GetPlayerVehicleID(playerid);
                    RemovePlayerFromVehicle(playerid);
                    SetVehicleToRespawn(Batz);
                    return TogglePlayerControllable(playerid,1);
                }
                else return SendClientMessage(playerid, COLOR_WHITE, "Where is your truck? Consider this.");
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "You are not on any mission!");
                return 1;
            }
            return 1;
}

Updated!
Reply
#3

Thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)