Quote:
Originally Posted by Hansrutger
Have you tried to Toggle the player with the actual function? Not sure if that will solve anything but worth a try.
Another idea would be to set up an array:
pawn Код:
//above in the script: new freezedPlayer[MAX_PLAYERS];
//when freezing a player, do without quotation marks: "freezedPlayer[targetID]*= 1;"
//when unfreezing a player, turn it back to 0
//somewhere else using a task/timer to perform a checkup if player is freezed and in a car: task FreezedPlayerEscape[1000]() // formula: "task nameOfTimer[interval in milliseconds](any variable passed along?) { for(new i = 0; i <= MAX_PLAYERS; i++) { if((freezedPlayer[i] == 1) && (IsPlayerInAnyVehicle(i))) //if player is freezer and if player is in vehicle { RemovePlayerFromVehicle(i); //freeze the player again and make the same animation here as well } } }
Just an idea. And if commenting: "Why using an int array and not boolean?" Because with this array you maybe want to have different kinds of freezing options: number 2 meaning being cuffed, 3 meaning to that you hit a wall with your car. Both of these can collide with each other if used as only true or false options. If you understand what I mean. ^^ And yes this might not be the most optimal solution! :P
EDIT: Almost forgot to put this: https://sampforum.blast.hk/showthread.php?tid=182948 if you want more information about constant going timers.
|
Thanks man, I fixed the problem.