SA-MP Forums Archive
Car respawn after command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car respawn after command (/showthread.php?tid=353733)



Car respawn after command - PaulDinam - 24.06.2012

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;
    }



Re: Car respawn after command - Grand_Micha - 24.06.2012

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!


Re: Car respawn after command - PaulDinam - 24.06.2012

Thanks!