01.03.2014, 15:00
Well... if you're creating an object under OnGameModeInit (Only gets called once...), and destroying it every time a player exits a vehicle (which can be called thousands of times...), don't you think you're going to run into trouble?
So... my question WAS of importance to this issue, thank you very much...
Simple...
So... my question WAS of importance to this issue, thank you very much...
pawn Код:
new objectid2[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
objectid2[playerid] = INVALID_OBJECT_ID;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
//Stuff here
new vehicleid = GetPlayerVehicleID(playerid);
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
objectid2[playerid] = CreateObject(1582, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(objectid2[playerid], vehicleid, 0, -1, 0.5, -1.6, 0.0, 0.0);
}
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
{
DestroyObject(objectid2[playerid]);
objectid2[playerid] = INVALID_OBJECT_ID;
}
//More stuff here...
return 1;
}