11.12.2016, 12:46
Hello. I have a problem. When the server fail or restart the GamePanel, playerii not receive Status 0, ie offline and the panel, they appear to be online on the server, but actually they are not on the server. Can you help me? Thank you in advance.
Besides, I have a problem. I have a dynamic private vehicles, and when the player comes on the server does not cripples cars.
stock DestroyPVehs(playerid)
{
new x = 1;
for(new c=0;c<MAX_VEH_PERS;c++)
{
if(strmatch(CarInfo[c][cOwner], PlayerInfo[playerid][pNormalName]))
{
if(OwnedVeh(GetIdOwn(GetSlot(playerid,x-1))))
{
OwnedVeh© = 0;
DestroyVehicle©;
foreach(Player,i)
{
if(HireCar == c)
{
HireCar = -1;
SwitchKey = 2;
}
}
x++;
}
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DestroyPVehs(playerid);
return 1;
}
stock GetSlot(playerid,slotid)
{
new x = -1,vehid;
for(new c;c<MAX_VEH_PERS;c++)
{
if(strmatch( CarInfo[c][cOwner], PlayerInfo[playerid][pNormalName] ) )
{
x++;
vehid = c;
if(x == slotid)
return vehid;
}
}
return 0;
}
stock GetVehNumber(playerid)
{
new nr = 0;
for(new i = 1; i < MAX_VEH_PERS; i++)
{
if(strmatch(CarInfo[i][cOwner], PlayerInfo[playerid][pNormalName]))
nr ++;
}
return nr;
}
stock GetIdOwn(carid)
{
for(new v;v<MAX_VEH_PERS;v++)
{
if(carid == OwnedVeh(v))
return v;
}
return 0;
}
Besides, I have a problem. I have a dynamic private vehicles, and when the player comes on the server does not cripples cars.
stock DestroyPVehs(playerid)
{
new x = 1;
for(new c=0;c<MAX_VEH_PERS;c++)
{
if(strmatch(CarInfo[c][cOwner], PlayerInfo[playerid][pNormalName]))
{
if(OwnedVeh(GetIdOwn(GetSlot(playerid,x-1))))
{
OwnedVeh© = 0;
DestroyVehicle©;
foreach(Player,i)
{
if(HireCar == c)
{
HireCar = -1;
SwitchKey = 2;
}
}
x++;
}
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DestroyPVehs(playerid);
return 1;
}
stock GetSlot(playerid,slotid)
{
new x = -1,vehid;
for(new c;c<MAX_VEH_PERS;c++)
{
if(strmatch( CarInfo[c][cOwner], PlayerInfo[playerid][pNormalName] ) )
{
x++;
vehid = c;
if(x == slotid)
return vehid;
}
}
return 0;
}
stock GetVehNumber(playerid)
{
new nr = 0;
for(new i = 1; i < MAX_VEH_PERS; i++)
{
if(strmatch(CarInfo[i][cOwner], PlayerInfo[playerid][pNormalName]))
nr ++;
}
return nr;
}
stock GetIdOwn(carid)
{
for(new v;v<MAX_VEH_PERS;v++)
{
if(carid == OwnedVeh(v))
return v;
}
return 0;
}