Stock problem
#1

Im having some problems with this stock:

pawn Code:
stock ShowJobStats(playerid)
{
    new temp[600];
    new info[600];
    switch (Player[playerid][Job])
    {
        case 0;
        {
        SendClientMessage(playerid,COLOR_RED,"* You don't have a job. Get one from City Hall.");
        }
        case 1;
        {
        format(temp, sizeof(temp), ""SAMP_BLUE"Drug Dealer Job Stats\n");
        strcat(info, temp);
        format(temp, sizeof(temp), "Marijuana Seeds: "ORANGE_RED"%d\n\n",Player[playerid][MarijuanaSeeds]);
        strcat(info, temp);
        format(temp, sizeof(temp), ""WHITE"Cocaine Seeds: "ORANGE_RED"%d\n\n",Player[playerid][CocaineSeeds]);
        strcat(info, temp);
        format(temp, sizeof(temp), ""WHITE"Heroin Seeds: "ORANGE_RED"%d\n\n",Player[playerid][HeroinSeeds]);
        strcat(info, temp);
        format(temp, sizeof(temp), ""WHITE"Drugs: "ORANGE_RED"%d "WHITE"grams\n\n",Player[playerid][Drugs]);
        strcat(info, temp);
        format(temp, sizeof(temp), ""WHITE"Money Earned From Selling Drugs: "ORANGE_RED"%s\n\n",formatInt(Player[playerid][DrugEarnings]));
        strcat(info, temp);
        }
        case 2;
        {
        format(temp, sizeof(temp), ""SAMP_BLUE"Weapons Dealer Job Stats\n");
        strcat(info, temp);
        }
        case 3;
        {
        format(temp, sizeof(temp), ""SAMP_BLUE"Trucker Job Stats\n");
        strcat(info, temp);
        }
        case 4;
        {
        format(temp, sizeof(temp), ""SAMP_BLUE"Taxi Driver Job Stats\n");
        strcat(info, temp);
        }
        case 5;
        {
        format(temp, sizeof(temp), ""SAMP_BLUE"Bus Driver Job Stats\n");
        strcat(info, temp);
        }
        case 6;
        {
        format(temp, sizeof(temp), ""SAMP_BLUE"Mechanic Job Stats\n");
        strcat(info, temp);
        }
        case 7;
        {
        format(temp, sizeof(temp), ""SAMP_BLUE"Pizza Boy Job Stats\n");
        strcat(info, temp);
        }
    }

    ShowPlayerDialog(playerid, DIALOG_JOB_STATS, DIALOG_STYLE_MSGBOX,""ORANGE_RED"Job Stats",info,"Close","");
    return 1;
}
Quote:

(2695) : error 001: expected token: ":", but found ";"
(2695) : error 036: empty statement
(2692) : warning 204: symbol is assigned a value that is never used: "info"
(2691) : warning 204: symbol is assigned a value that is never used: "temp"
(2691 -- 2699) : error 010: invalid function or declaration
(2691 -- 2699) : fatal error 107: too many error messages on one line

Basically, im creating "info - temp" to handle all job stats, instead of creating two different info/temp for each job. What's wrong?
Reply
#2

PHP Code:
stock ShowJobStats(playerid)
{
    new 
temp[300];
    switch (
Player[playerid][Job])
    {
        case 
0:
        {
            
SendClientMessage(playerid,COLOR_RED,"* You don't have a job. Get one from City Hall.");
        }
        case 
1:
        {
            
format(tempsizeof(temp), ""SAMP_BLUE"Drug Dealer Job Stats\n");
            
format(tempsizeof(temp), "Marijuana Seeds: "ORANGE_RED"%d\n\n",Player[playerid][MarijuanaSeeds]);
            
format(tempsizeof(temp), ""WHITE"Cocaine Seeds: "ORANGE_RED"%d\n\n",Player[playerid][CocaineSeeds]);
            
format(tempsizeof(temp), ""WHITE"Heroin Seeds: "ORANGE_RED"%d\n\n",Player[playerid][HeroinSeeds]);
            
format(tempsizeof(temp), ""WHITE"Drugs: "ORANGE_RED"%d "WHITE"grams\n\n",Player[playerid][Drugs]);
            
format(tempsizeof(temp), ""WHITE"Money Earned From Selling Drugs: "ORANGE_RED"%s\n\n",formatInt(Player[playerid][DrugEarnings]));
        }
        case 
2:
        {
            
format(tempsizeof(temp), ""SAMP_BLUE"Weapons Dealer Job Stats\n");
        }
        case 
3:
        {
            
format(tempsizeof(temp), ""SAMP_BLUE"Trucker Job Stats\n");      
        }
        case 
4:
        {
            
format(tempsizeof(temp), ""SAMP_BLUE"Taxi Driver Job Stats\n");        
        }
        case 
5:
        {
            
format(tempsizeof(temp), ""SAMP_BLUE"Bus Driver Job Stats\n");        
        }
        case 
6:
        {
            
format(tempsizeof(temp), ""SAMP_BLUE"Mechanic Job Stats\n");       
        }
        case 
7:
        {
            
format(tempsizeof(temp), ""SAMP_BLUE"Pizza Boy Job Stats\n");        
        }
    }
    
ShowPlayerDialog(playeridDIALOG_JOB_STATSDIALOG_STYLE_MSGBOX,""ORANGE_RED"Job Stats",temp,"Close","");
    return 
1;

Ti complichi la vita.
Reply
#3

Oh Madonna ahahahaha! Grazie mille, lo provo e ti faccio sapere.

Ti ho dato un po' di reputazione.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)