[HELP] All cars locked!
#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


Messages In This Thread
[HELP] All cars locked! - by KeyWay - 08.06.2009, 12:05
Re: [HELP] All cars locked! - by shitbird - 08.06.2009, 12:34
Re: [HELP] All cars locked! - by KeyWay - 08.06.2009, 12:41
Re: [HELP] All cars locked! - by shitbird - 08.06.2009, 12:45
Re: [HELP] All cars locked! - by KeyWay - 08.06.2009, 12:57
Re: [HELP] All cars locked! - by shitbird - 08.06.2009, 13:13
Re: [HELP] All cars locked! - by KeyWay - 08.06.2009, 13:20
Re: [HELP] All cars locked! - by KeyWay - 08.06.2009, 13:20
Re: [HELP] All cars locked! - by shitbird - 08.06.2009, 13:24
Re: [HELP] All cars locked! - by KeyWay - 08.06.2009, 15:00

Forum Jump:


Users browsing this thread: 3 Guest(s)