27.07.2011, 11:31
Hello everybody, 
So I was thinking... Is there some OnGameModeExit() alternatives? OnGameModeExit() is called just when you type in console: exit, but I need it to be call, lets say when my server crashes or when I turn off my server with "X", not with typing: exit. Any sollutions?
CAR LOCKING problem:
I've made a little command like this:
I think it should lock the car if it's unlocked, and unlock, if it's locked. But it doesn't. It just locks a car. Anyone knows why?

So I was thinking... Is there some OnGameModeExit() alternatives? OnGameModeExit() is called just when you type in console: exit, but I need it to be call, lets say when my server crashes or when I turn off my server with "X", not with typing: exit. Any sollutions?
CAR LOCKING problem:
I've made a little command like this:
pawn Код:
if(!strcmp(cmdtext,"/lock",true))
{
new carid = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
for(new i = 0; i < MAX_VEHICLES; i++)
{
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid, px, py, pz);
if(VehicleToPoint(100, i, px, py, pz))
{
new IsOwner[MAX_PLAYER_NAME];
GetPlayerName(playerid, IsOwner, sizeof(IsOwner));
if(strmatch(CarInfo[i][owner], IsOwner))
{
if(doors == 0)
{
SetVehicleParamsEx(i,engine,lights,alarm,1,bonnet,boot,objective);
}
if(doors == 1)
{
SetVehicleParamsEx(i,engine,lights,alarm,0,bonnet,boot,objective);
}
}
}
}
return 1;
}