GivePlayerWeapon
#1

So I have a struggle with this, I want to give weapon to a specific class. Weapons appear perfectly for police class but for mafia class they won't show up.



Here are the defines:

PHP код:
new bool:PoliceGetsWeapons true;
new 
bool:MafiaGetsWeapons true;
new 
APoliceWeapons[4] = {24253129};
new 
PoliceWeaponsAmmo 5000;
new 
AMafiaWeapons[3] = {223032};
new 
MafiaWeaponsAmmo 5000

This is the command under police class:

PHP код:
        case ClassPolice// Police class
        
{
            
format(missiontextsizeof(missiontext), Police_NoJobText); // Preset the missiontext
            
SetPlayerColor(playeridColorClassPolice); // Set the playercolor (chatcolor for the player and color on the map)
            // Start the PlayerCheckTimer to scan <a href="http://cityadspix.com/tsclick-BQBE4NPP-VRMIQUYF?url=http%3A%2F%2Fwww.enter.ru%2Fproduct%2Felectronics%2Figra-dlya-ps-vita-need-for-speed-most-wanted-2060401013472&sa=mh&sa1=&sa2=&sa3=&sa4=&sa5=&bt=20&pt=9&lt=2&tl=3&im=Mjc3NS0wLTE0MTgxMjM1ODYtMTQ3Njg5MDg%3D&fid=NDQ1NzU2Nzc1&prdct=023008390e390c3206&kw=for%20wanted" target="_blank" alt="Need for Speed: Most Wanted" title="Need for Speed: Most Wanted" style="">for wanted</a> players (be sure the timer has been destroyed first)
            
KillTimer(APlayerData[playerid][PlayerCheckTimer]);
            
APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Police_CheckWantedPlayers"1000true"i"playerid);
            
// Check if the police player can get weapons
            
if (PoliceGetsWeapons == true)
            {
                
// Give up to 12 weapons to the player
                
for (new i4i++)
                    
GivePlayerWeapon(playeridAPoliceWeapons[i], PoliceWeaponsAmmo);
            }
        } 
This is the command under mafia class:

PHP код:
        case ClassMafia// Mafia class
        
{
            
format(missiontextsizeof(missiontext), Mafia_NoJobText); // Preset the missiontext
            
SetPlayerColor(playeridColorClassMafia); // Set the playercolor (chatcolor for the player and color on the map)
            // Start the PlayerCheckTimer to scan for players that carry mafia-loads (be sure the timer has been destroyed first)
            
KillTimer(APlayerData[playerid][PlayerCheckTimer]);
            
APlayerData[playerid][PlayerCheckTimer] = SetTimerEx("Mafia_CheckMafiaLoads"1000true"i"playerid);
            
// Check if the mafia player can get weapons
            
if (MafiaGetsWeapons == true)
            {
                
// Give up to 12 weapons to the player
                
for (new i3i++)
                    
GivePlayerWeapon(playeridAMafiaWeapons[i], MafiaWeaponsAmmo);
            }
        } 
I honestly, can't see any issue, gamemode compiles alright too.
Reply


Messages In This Thread
GivePlayerWeapon problems [+REP] - by Jhony_Blaze - 08.12.2014, 19:25
Re: GivePlayerWeapon - by Jhony_Blaze - 09.12.2014, 09:55
Re: GivePlayerWeapon - by Threshold - 09.12.2014, 10:48
Re: GivePlayerWeapon - by Jhony_Blaze - 09.12.2014, 11:03
Re: GivePlayerWeapon - by Threshold - 09.12.2014, 11:07
Re: GivePlayerWeapon - by Jhony_Blaze - 09.12.2014, 11:58
Re: GivePlayerWeapon - by Threshold - 09.12.2014, 12:03
Re: GivePlayerWeapon - by Jhony_Blaze - 09.12.2014, 12:15
Re: GivePlayerWeapon - by Jhony_Blaze - 09.12.2014, 14:42
Re: GivePlayerWeapon - by Jhony_Blaze - 10.12.2014, 16:03

Forum Jump:


Users browsing this thread: 1 Guest(s)