09.05.2016, 17:46
Hi, this script is supposed to make player struggle when shot in any leg, but the chance is 1 in 2 as I understand, but I get these errors:
Code:
How to fix it? Or there's a better way to make it random?
I tried putting new Struggle = Random(1); at the top of the script, but when I compile it successfully compiles, but pawno crashes.
Код:
(21) : error 017: undefined symbol "Random" (41) : error 017: undefined symbol "Random"
Код:
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) { SetPlayerHealth(playerid, 0.0); } if(bodypart == 7) { if(IsPlayerInAnyVehicle(playerid)) { } else { new Struggle = Random(1); switch(Struggle) { case 1: { ApplyAnimation(playerid, "ped", "FALL_collapse", 4.1, 0, 1, 1, 0, 0, 1); } case 2: { } } } } if(bodypart == 8) { if(IsPlayerInAnyVehicle(playerid)) { } else { new Struggle = Random(1); switch(Struggle) { case 1: { ApplyAnimation(playerid, "ped", "FALL_collapse", 4.1, 0, 1, 1, 0, 0, 1); } case 2: { } } } }
I tried putting new Struggle = Random(1); at the top of the script, but when I compile it successfully compiles, but pawno crashes.