Help!
#6

Well, I suggest you using a global variable for this case. This i assume is a Temporary Vehicle, created only for one player, So i don't think you should respawn it. Example of what i mean

pawn Код:
if(dialogid == 5)
{
if(response)
{
if(listitem == 0)
{
SetPlayerVirtualWorld(playerid, 2);
SetPlayerPos(playerid,-2421.2092,-610.8815,132.2896);
PlVeh[playerid] = CreateVehicle(562,-2421.2092,-610.8815,132.2896,0.0,0,0,100);
}
else if(listitem == 1)
{
SetPlayerHealth(playerid,0);
}
}
In the Leave command:

pawn Код:
DestroyVehicle(PlVeh[playerid]);
PlVeh[playerid] = 0; // Reseting The Variable
And on the top of your script
pawn Код:
new PlVeh[MAX_PLAYERS];
And What else we need is to reset that variable and remove the vehicle if the player leaves the server:

(OnPlayerDisconnect)

pawn Код:
DestroyVehicle(PlVeh[playerid]);
PlVeh[playerid] = 0;
Now, this is a bit of a Simpler, but slower and a way i Do not Suggest , Professionally i would use an if Statement to check if PlVeh[playerid] is a valid vehicle.
Reply


Messages In This Thread
Help! - by jaksimaksi - 14.01.2011, 19:05
Re: Help! - by JaTochNietDan - 14.01.2011, 19:23
Re: Help! - by jaksimaksi - 14.01.2011, 19:59
Re: Help! - by aircombat - 14.01.2011, 20:41
AW: Help! - by Kmitska - 14.01.2011, 20:42
Re: Help! - by DeadAhead - 14.01.2011, 20:58

Forum Jump:


Users browsing this thread: 2 Guest(s)