08.12.2014, 19:25
(
Последний раз редактировалось Jhony_Blaze; 09.12.2014 в 10:25.
)
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:
This is the command under police class:
This is the command under mafia class:
I honestly, can't see any issue, gamemode compiles alright too.
Here are the defines:
PHP код:
new bool:PoliceGetsWeapons = true;
new bool:MafiaGetsWeapons = true;
new APoliceWeapons[4] = {24, 25, 31, 29};
new PoliceWeaponsAmmo = 5000;
new AMafiaWeapons[3] = {22, 30, 32};
new MafiaWeaponsAmmo = 5000;
This is the command under police class:
PHP код:
case ClassPolice: // Police class
{
format(missiontext, sizeof(missiontext), Police_NoJobText); // Preset the missiontext
SetPlayerColor(playerid, ColorClassPolice); // 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<=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", 1000, true, "i", playerid);
// Check if the police player can get weapons
if (PoliceGetsWeapons == true)
{
// Give up to 12 weapons to the player
for (new i; i < 4; i++)
GivePlayerWeapon(playerid, APoliceWeapons[i], PoliceWeaponsAmmo);
}
}
PHP код:
case ClassMafia: // Mafia class
{
format(missiontext, sizeof(missiontext), Mafia_NoJobText); // Preset the missiontext
SetPlayerColor(playerid, ColorClassMafia); // 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", 1000, true, "i", playerid);
// Check if the mafia player can get weapons
if (MafiaGetsWeapons == true)
{
// Give up to 12 weapons to the player
for (new i; i < 3; i++)
GivePlayerWeapon(playerid, AMafiaWeapons[i], MafiaWeaponsAmmo);
}
}