[HELP] All cars locked!
#1

Hey guys,

I tryed to find a solution to this long long time.

Just some random times, all server cars gets locked... Im not sure for everyone, but once me and my friend got that bug same time. Well the solution is /unlockallcars and then all cars are unlocked. But omg i cant just be on server 24/7 and make /unlockallcars every 30min.. Anyone know what could cause that?
Reply
#2

Most likely a server side error, check if there is any timer setting the Cars lock on.
Reply
#3

Quote:
Originally Posted by sbґ
Most likely a server side error, check if there is any timer setting the Cars lock on.
I checked. Didnt notice any timer that locks cars...
Reply
#4

Any filterscripts?
Reply
#5

Quote:
Originally Posted by sbґ
Any filterscripts?
No they dont have either...
Reply
#6

Search for

pawn Код:
SetVehicleParamsForPlayer
In your script, if something comes up, tell us.
Reply
#7

Quote:

public unlock(playerid,vehicleid)
{
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(vehicleid,i, 0, 0);
}
locked[playerid][vehicleid] = 0;
}

Quote:

public OnPlayerDisconnect(playerid)
{
new i2;
for(i2=0;i2<MAX_VEHICLES;i2++)
{
if (locked[playerid][i2] == 1)
{
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(i2,i, 0, 0);
}
}
locked[playerid][i2] = 0;
}

Quote:

public CarCheck()
{
new string[256];
for(new j = 0; j<MAX_PLAYERS; j++)
{
if(IsPlayerConnected(j))
{
new Float:health;
GetPlayerHealth(j, health);
if(STDPlayer[j]==1)
{
GetPlayerHealth(j, health);
SetPlayerHealth(j, health - 5.0);
SendClientMessage(j, COLOR_LIGHTBLUE, "* Lost 4 health due to STD.");
}
else if(STDPlayer[j]==2)
{
GetPlayerHealth(j, health);
SetPlayerHealth(j, health - 12.0);
SendClientMessage(j, COLOR_LIGHTBLUE, "* Lost 8 health due to STD.");
}
else if(STDPlayer[j]==3)
{
GetPlayerHealth(j, health);
SetPlayerHealth(j, health - 20.0);
SendClientMessage(j, COLOR_LIGHTBLUE, "* Lost 12 health due to STD.");
}

if(GetPlayerMoney(j) < 0)
{
if(MoneyMessage[j]==0)
{
format(string, sizeof(string), "You are in debt, you have till next Time Check to get: $%d or you go to jail.", GetPlayerMoney(j));
SendClientMessage(j, COLOR_LIGHTRED, string);
MoneyMessage[j] = 1;
}
}
else
{
MoneyMessage[j] = 0;
}
}
}
for(new c = 1; c < 254; c++)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (PlayerInfo[i][pJob] == 5)
{
SetVehicleParamsForPlayer(c, i, 0, 0);
}
}
}
if (gLastDriver[c] >= 300)
{
gLastDriver[c]++;
}
//foundowner = -1;
}
return 1;
}

Quote:

public LockCar(carid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(carid,i,0,1);
}
}
}

public UnLockCar(carid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(!IsAPlane(carid))
{
SetVehicleParamsForPlayer(carid,i,0,0);
}
}
}
}

Quote:

public InitLockDoors(playerid)
{
if(IsPlayerConnected(playerid))
{
new c;
while (c < 254)
{
c++;
if (gCarLock[c] == 1)
{
SetVehicleParamsForPlayer(c,playerid,0,1);
}
}
}
return 1;
}

Quote:

if (strcmp(cmdtext, "/lock", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,0xAFAFAFAA,"You can only lock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i, 0, 1);
}
}
SendClientMessage(playerid, 0xAFAFAFAA, "Vehicle locked!");
new FloatX, FloatY, FloatZ;
GetPlayerPos(playerid,pX,pY,pZ);
PlayerPlaySound(playerid,1056,pX,pY,pZ);
locked[playerid][GetPlayerVehicleID(playerid)] = 1;
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, "You're not in a vehicle!");
}
return 1;
}
if (strcmp(cmdtext, "/unlock", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,0xAFAFAFAA,"You can only lock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playe rid),i, 0, 0);
}
SendClientMessage(playerid, 0xAFAFAFAA, "Vehicle unlocked!");
new FloatX, FloatY, FloatZ;
GetPlayerPos(playerid,pX,pY,pZ);
PlayerPlaySound(playerid,1057,pX,pY,pZ);
locked[playerid][GetPlayerVehicleID(playerid)] = 0;
}
else
{
SendClientMessage(playerid, 0xAFAFAFAA, "You're not in a vehicle!");
}
return 1;
}

All that uses SetVehicleParamsForPlayer. Maybe i dont even need some of these..
Reply
#8

EDIT: Sorry DB
Reply
#9

pawn Код:
public LockCar(carid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
   if(IsPlayerConnected(i))
   {
     SetVehicleParamsForPlayer(carid,i,0,1);
   }
  }
}
What exactly is this for? you are checking if players are connected, and if any player is connected, it locks the car. But, what is carid?...
Reply
#10

Quote:
Originally Posted by sbґ
pawn Код:
public LockCar(carid)
{
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
   if(IsPlayerConnected(i))
   {
    SetVehicleParamsForPlayer(carid,i,0,1);
   }
 }
}
What exactly is this for? you are checking if players are connected, and if any player is connected, it locks the car. But, what is carid?...
I checked that. I didnt see that my GM is even using that, it was propably for rented car or something... So i think i can remove it, maybe thats the problem?


Thanks for replying.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)