SA-MP Forums Archive
Vehicle system: CreateVehicle when owner logs on - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Vehicle system: CreateVehicle when owner logs on (/showthread.php?tid=191905)



Vehicle system: CreateVehicle when owner logs on - Biesmen - 20.11.2010

Yeye, I have an other question, because I don't really have an idea how to make this properly.
I want the car to be spawned if the owner logs in. Except if the owner is "ForSale".

At the login function I added this command, but yeah, as soon as one player logs in, all cars will be spawned.
Tried to add at OnGameModeInit a check if the carowner logs in by using this:
pawn Код:
if(IsPlayerConnected(!strcmp(PlayerName, COwnerData[i][CarOwner], false))
(Just to give you an expression of what I mean)

I have to create different, forgot how it's called; 'CreateVehicles' for the exception, right?
But how do I do that.

I hope you can answer these two questions

Thank you.

I'm using this to spawn the vehicles:
pawn Код:
for(new i; i < sizeof(COwnerData); i++)
{
COwnerData[i][CarID] = CreateVehicle(blablabla);
}



Re: Vehicle system: CreateVehicle when owner logs on - Biesmen - 21.11.2010

Still looking for help.

I tried:
edit: removed, it failed.


Re: Vehicle system: CreateVehicle when owner logs on - Cameltoe - 21.11.2010

pawn Код:
// OnPlayerConnect
for(new i; i < MAX_VEHICLES + 1; i++)
{
     if(strmatch(COwnerData[i][CarOwner], PlayerName(playerid)))
     {
           //CreateVehicle shit here
     }
}



Re: Vehicle system: CreateVehicle when owner logs on - ivex - 21.11.2010

Or , you can save vehicle data in PlayerFile .. so when vehicle will be created when player logs in and destroyed when player disconnect


Re: Vehicle system: CreateVehicle when owner logs on - Biesmen - 21.11.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
pawn Код:
// OnPlayerConnect
for(new i; i < MAX_VEHICLES + 1; i++)
{
     if(strmatch(COwnerData[i][CarOwner], PlayerName(playerid)))
     {
           //CreateVehicle shit here
     }
}
Edit:
Works, thanks.