PHP код:
GivePlayerValidWeapon(playerid, WeaponID){
if((Info[playerid][pConnectTime] < 2 || Info[playerid][pWRestricted] > 0) && WeaponID != 46 && WeaponID != 43) return 1;
switch( WeaponID ){
case 0, 1:{
Info[playerid][pWeapons][ 0 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 1);
}
case 2, 3, 4, 5, 6, 7, 8, 9:{
Info[playerid][pWeapons][ 1 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 1);
}
case 22, 23, 24:{
Info[playerid][pWeapons][ 2 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 7);
}
case 25, 26, 27:{
Info[playerid][pWeapons][ 3 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 7);
}
case 28, 29, 32:{
Info[playerid][pWeapons][ 4 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 30);
}
case 30, 31:{
Info[playerid][pWeapons][ 5 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 30);
}
case 33, 34:{
Info[playerid][pWeapons][ 6 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 7);
}
case 35, 36, 37, 38:{
Info[playerid][pWeapons][ 7 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 0);
}
case 16, 17, 18, 39:{
Info[playerid][pWeapons][ 8 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 0);
}
case 41, 42, 43:{
Info[playerid][pWeapons][ 9 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 1);
}
case 10, 11, 12, 13, 14, 15:{
Info[playerid][pWeapons][ 10 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 1);
}
case 44, 45, 46:{
Info[playerid][pWeapons][ 11 ] = WeaponID;
GivePlayerWeapon( playerid, WeaponID, 1);
}
case 40: {
Info[playerid][pWeapons][12] = WeaponID;
GivePlayerWeapon(playerid, WeaponID, 0);
}
}
return 1;
}