29.09.2015, 16:11
EDT: Nevermind guys, I fixed it by using onplayerentervehicle instead of onplayerstatechange, cheers.
Alright so I'll make this simple for you guys to understand, I got house system as Filterscript which I don't want to implement inside the gamemode and I got antifall inside the gamemode which I can't implement inside that filterscript..
so I got this code for the antifall:
and I got something like this when someone enters a house-car that isn't theirs:
What happens is that I automatically get kicked off from the vehicle however antifall puts me back on because it thinks I fell to the ground from that vehicle.
One of the solutions would be to only enable anti fall for the spawned vehicles /car or /v but I'm wondering if you guys have a better way to detect if a player got ejected or if he fell.
Thank you for reading and I appreciate your time.
Alright so I'll make this simple for you guys to understand, I got house system as Filterscript which I don't want to implement inside the gamemode and I got antifall inside the gamemode which I can't implement inside that filterscript..
so I got this code for the antifall:
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(Act[playerid] == 1) { if(oldstate == PLAYER_STATE_DRIVER) { if(newstate == PLAYER_STATE_ONFOOT) { if(InCar[playerid] == 1) { if(GetVehicleModel(WhatCar[playerid]) != 441 || GetVehicleModel(WhatCar[playerid]) != 464 || GetVehicleModel(WhatCar[playerid]) != 465 || GetVehicleModel(WhatCar[playerid]) != 501 || GetVehicleModel(WhatCar[playerid]) != 564 || GetVehicleModel(WhatCar[playerid]) != 594) PutPlayerInVehicle(playerid, WhatCar[playerid], Driver); } } } else if(oldstate == PLAYER_STATE_ONFOOT) { if(newstate == PLAYER_STATE_DRIVER) { InCar[playerid] = 1; WhatCar[playerid] = GetPlayerVehicleID(playerid); } } } return 1; }
Код:
RemovePlayerFromVehicle(playerid);
One of the solutions would be to only enable anti fall for the spawned vehicles /car or /v but I'm wondering if you guys have a better way to detect if a player got ejected or if he fell.
Thank you for reading and I appreciate your time.