31/01/2021 20:57
(31/01/2021 20:25)Hatiro Escreveu:Nao funcionou mano eu to achando que quando o player ta travado com o TogglePlayerControllable as teclas funfamtalvez o if nem tava sendo executadoCódigo:public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
if(newkeys == KEY_SPRINT && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { // quando apertar 'H' NO POSTO
if(IsPlayerInRangeOfPoint(playerid, 7, 1939.1224, -1775.5885, 12.9718)) {
TogglePlayerControllable(playerid, 0);
for(new pc; pc != 4; pc++) PlayerTextDrawShow(playerid, PostGas[playerid][pc]);
}
}
else if(newkeys == KEY_HANDBRAKE) { // quando apertar 'ESPAÇO' NO POSTO
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
TogglePlayerControllable(playerid, 1);
for(new pc; pc != 4; pc++) PlayerTextDrawHide(playerid, PostGas[playerid][pc]);
}
}
return 1;
}