Lock vehicle for everyone when owner is not online... Help please.
#1

How to lock a vehicle for EVERYONE... And when the owner of the car comes online, the vehicle will be locked for everyone except him/her...
Reply
#2

I've comed this far:

pawn Код:
if( Owner is offline ) //Change please...
{
    SetVehicleParamsForPlayer(vehicleid,255,0,1);
}
else
{
    SetVehicleParamsForPlayer(vehicleid,playerid,0,1); // I Don't know how to check if the owner is offline or online
}
Reply
#3

pawn Код:
new pn[24];
for(new i=0; i<MAX_PLAYERS; i++)
{
    GetPlayerName(i, pn, 24);
    if(strcmp(pn, "YourNameInGame"))
        SetVehicleParamsForPlayer(vehicleid, i, 0, 1); //Remember to change "YourNameInGame" and vehicleid
}
Put that inside OnGameModeInit
Reply
#4

Or put it in OnPlayerConnect
Reply
#5

I do a for loop for a reason :P
So you don't have to call SetVehicle... Everytime a player connects
Reply
#6

When a player connects you need to set the params for them too,
A loop wont do shit to offline players,
Just dont use a loop and put the code in OnPlayerConnect
Reply
#7

Ah I forgot ...
Reply
#8

Quote:
Originally Posted by lrZ^ aka LarzI
pawn Код:
new pn[24];
for(new i=0; i<MAX_PLAYERS; i++)
{
    GetPlayerName(i, pn, 24);
    if(strcmp(pn, "YourNameInGame"))
        SetVehicleParamsForPlayer(vehicleid, i, 0, 1); //Remember to change "YourNameInGame" and vehicleid
}
Put that inside OnGameModeInit
I don't see how that can lock the cars for everyone, if My InGame name is not online... =/
Reply
#9

You should save every car in a file..
Reply
#10

Quote:
Originally Posted by иєσz
You should save every car in a file..
Why every?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)