ID 0 problem
#2

It could probably be because your pCompany Array is at 0 or over 3, Your code only checks it if it is between 1 - 3.
I have re-write your code and add a print function show us what it prints:

PHP код:
forward unloading(playerid); 
public 
unloading(playerid

    new 
gString[128], moneymsg[20], playerscore GetPlayerScore(playerid);
    
TogglePlayerControllable(playerid1); 
    
SendClientMessage(playeridCOLOR_GREEN"Well done! You completed the mission!");//sends the player a message 
    
format(gStringsizeof gString"%s has completed mission: %s"pName(playerid), iMissionText[playerid]);//formats the message 
    
SendClientMessageToAll(COLOR_GREENgString);//sends everyone message saying player completed mission 
    
MissionStatus[playerid] = 0;//sets the mission status of the player to '0' 
     
    
SetPlayerScore(playeridplayerscore ); 
    
GivePlayerMoney(playeridiPay[playerid]); 
    
format(moneymsgsizeof moneymsg"~y~+%d~g~$"iPay[playerid]); 
    
GameTextForPlayer(playeridmoneymsg50001);

    
printf("Array pCompany: %i"PlayerInfo[playerid][pCompany]); // added for debugging

    
if(PlayerInfo[playerid][pCompany] == 1
    { 
        
SendClientMessage(playeridCOL_POSITIVE"Company bonus money: 3000$"); 
        
GivePlayerMoney(playerid3000); 
    } 
    else if(
PlayerInfo[playerid][pCompany] == 2
    { 
        
SendClientMessage(playeridCOL_POSITIVE"Company bonus money: 6000$"); 
        
GivePlayerMoney(playerid6000); 
    } 
    else if(
PlayerInfo[playerid][pCompany] == 3
    { 
        
SendClientMessage(playeridCOL_POSITIVE"Company bonus money: 12000$"); 
        
GivePlayerMoney(playerid12000); 
    } 
    return 
true

Reply


Messages In This Thread
ID 0 problem - by nikolat007 - 02.11.2017, 20:32
Re: ID 0 problem - by ISmokezU - 02.11.2017, 22:02

Forum Jump:


Users browsing this thread: 1 Guest(s)