Problem with player spawn After the race.
#1

Hellu,
I have a problem with the player spawn. Sorry i'm posting many threads but yeah i need help.
my problem is : when i finish the race and i type /kill to check whether its bug or not. so when i type /kill i got spawned at the start of the race again after death. I want that if player has finished the race once so set his pos at the end of the race where he finished. not at that starting of race.

here are the codes.:

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerRaceCheckpoint(playerid, 0,-2264.8501,2312.7566,4.5473,-2271.4414,2351.0659,4.4289,10);
    Stats[playerid] = 1;
    SetPlayerColor(playerid, COLOR_YELLOW);
    SetPlayerTime(playerid,12,0);
    SetPlayerInterior(playerid,0);
    SetCameraBehindPlayer(playerid);
    SendClientMessage(playerid,0xFF0000FF,"{FF0000}» Usage: {FFFFFF}/re to repair your vehicle!");
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,0);
    new bmx = CreateVehicle(510,-2266.4817,2284.4314,4.4284,0,-1,-1,-1);
    PutPlayerInVehicle(playerid, bmx, 0);
    if(Free == 0)
    {
    TogglePlayerControllable(playerid, 0);
    }
    else if(Free == 1)
    {
    TogglePlayerControllable(playerid, 1);
    }
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{

    switch(Stats[playerid])
    {
         case 16: //////////////this is the last checkpoint. Race ending checkpoint
         {
              DisablePlayerRaceCheckpoint(playerid);
              PlayerPlaySound(playerid, 1056, 0.0, 0.0, 10.0);
              SetPlayerRaceCheckpoint(playerid, 1,-2720.3652,982.4440,54.0652,-2720.3652,982.4440,54.0652,10);
              Stats[playerid] = 17;
              return 1;
    }
    return 1;
}
Reply


Messages In This Thread
Problem with player spawn After the race. - by SpikY_ - 12.06.2015, 09:51
Re: Problem with player spawn After the race. - by Huba - 12.06.2015, 10:37
Re: Problem with player spawn After the race. - by SpikY_ - 12.06.2015, 11:30

Forum Jump:


Users browsing this thread: 1 Guest(s)