24.07.2018, 10:07
do a random with number of 100
compare the returned value...
->
compare the returned value...
->
PHP код:
else if(level >= 101 && level <= 200) // truck level 3
{
switch(random(100)) // random 9mm va sdpistol
{
case 0..44: // 9mm
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Ban nhan duoc mien phi 9mm cho viec van chuyen vu khi trai phep.");
SendClientMessageEx(playerid, COLOR_YELLOW, "* Khong duoc su dung vu khi duoc thuong cho muc dich xau nhu KOS/DM nonRP, neu vi pham se bi han che vu khi.");
GivePlayerValidWeapon(playerid, 22, 60000);
}
case 45..89: // sdpistol
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Ban nhan duoc mien phi sdpistol cho viec van chuyen vu khi trai phep.");
SendClientMessageEx(playerid, COLOR_YELLOW, "* Khong duoc su dung vu khi duoc thuong cho muc dich xau nhu KOS/DM nonRP, neu vi pham se bi han che vu khi.");
GivePlayerValidWeapon(playerid, 23, 60000);
}
case 90..99: // shotgun
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Ban nhan duoc mien phi Shotgun cho viec van chuyen vu khi trai phep.");
SendClientMessageEx(playerid, COLOR_YELLOW, "* Khong duoc su dung vu khi duoc thuong cho muc dich xau nhu KOS/DM nonRP, neu vi pham se bi han che vu khi.");
GivePlayerValidWeapon(playerid, 25, 60000);
}
}
}