Vehicle system: CreateVehicle when owner logs on
#1

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);
}
Reply
#2

Still looking for help.

I tried:
edit: removed, it failed.
Reply
#3

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)