question
#1

whats wrong here
Код:
switch(CP[playerid]){
		case 155: {
			new j = random(housess)+1; new stringe[256];
			if(j == 0) j = 1;
			SetPlayerCheckpoint(playerid, HouseInfo[j][hEntrancex],HouseInfo[j][hEntrancey],HouseInfo[j][hEntrancez], 7.0);
			format(string,sizeof(string),"(JOB) Pizza livrata cu succes, ai primit $%s.",FormatNumber(pizzaprize[playerid]));
			SendClientMessage(playerid, COLOR_WHITE, string);
			format(stringe, sizeof(stringe), "(JOB) Mergi la punctul rosu de pe minimap pentru a livra urmatoarea pizza, distanta: %0.1fm.", GetPlayerDistanceFromPoint(playerid, HouseInfo[j][hEntrancex],HouseInfo[j][hEntrancey],HouseInfo[j][hEntrancez]));
			SendClientMessage(playerid, COLOR_WHITE, stringe);
			PlayerInfo[playerid][pPizzaRem]--;
			PlayerInfo[playerid][pPizzaTimes]++;
			Update(playerid,pPizzaRemx);
			Update(playerid,pPizzaTimesx);
			GivePlayerCash(playerid,pizzaprize[playerid]);
			Update(playerid, pCashx);
			pizzaprize[playerid] = 0;
			else if(PlayerInfo[playerid][pPizzaSkill] <= 5)
			{
			if(PlayerInfo[playerid][pPizzaRem] <= 0)
			{
			    PlayerInfo[playerid][pPizzaSkill]++;
   				if(PlayerInfo[playerid][pPizzaSkill] == 2)
				{
					PlayerInfo[playerid][pPizzaRem] = 34; 
				}
				else if(PlayerInfo[playerid][pPizzaSkill] == 3)
				{
					PlayerInfo[playerid][pPizzaRem] = 49;
				}
				else if(PlayerInfo[playerid][pPizzaSkill] == 4)
				{
					PlayerInfo[playerid][pPizzaRem] = 89;
				}
				else if(PlayerInfo[playerid][pPizzaSkill] == 5)
				{
					PlayerInfo[playerid][pPizzaRem] = 99;
				}
		    	Update(playerid,pPizzaSkillx);
		    	Update(playerid,pPizzaRemx);
				new stringe[128];
			    format(string,sizeof(string),"Felicitari! Ai acum skill %d pentru acest job!",PlayerInfo[playerid][pPizzaSkill]);
				format(stringe,sizeof(stringe),"Congratulations! Now you have skill %d for this job!",PlayerInfo[playerid][pPizzaSkill]);
			    SS(playerid, COLOR_YELLOW, string, stringe);
			}
		}
	}
	return 1;
}
the errors are only given when i add the red part

Код:
D:\server\gamemodes\ExtremeGame.pwn(10639) : error 029: invalid expression, assumed zero
D:\server\gamemodes\ExtremeGame.pwn(10639) : warning 215: expression has no effect
D:\server\gamemodes\ExtremeGame.pwn(10639) : error 001: expected token: ";", but found "if"
D:\server\gamemodes\ExtremeGame.pwn(10662) : warning 219: local variable "stringe" shadows a variable at a preceding level
D:\server\gamemodes\ExtremeGame.pwn(10669) : error 002: only a single statement (or expression) can follow each "case"
D:\server\gamemodes\ExtremeGame.pwn(10669) : warning 215: expression has no effect
D:\server\gamemodes\ExtremeGame.pwn(10670) : warning 209: function "OnPlayerEnterCheckpoint" should return a value
Reply
#2

help
Reply
#3

you missed 1 bracket

heres the fix:

PHP код:
switch(CP[playerid]){
        case 
155: {
            new 
random(housess)+1; new stringe[256];
            if(
== 01;
            
SetPlayerCheckpoint(playeridHouseInfo[j][hEntrancex],HouseInfo[j][hEntrancey],HouseInfo[j][hEntrancez], 7.0);
            
format(string,sizeof(string),"(JOB) Pizza livrata cu succes, ai primit $%s.",FormatNumber(pizzaprize[playerid]));
            
SendClientMessage(playeridCOLOR_WHITEstring);
            
format(stringesizeof(stringe), "(JOB) Mergi la punctul rosu de pe minimap pentru a livra urmatoarea pizza, distanta: %0.1fm."GetPlayerDistanceFromPoint(playeridHouseInfo[j][hEntrancex],HouseInfo[j][hEntrancey],HouseInfo[j][hEntrancez]));
            
SendClientMessage(playeridCOLOR_WHITEstringe);
            
PlayerInfo[playerid][pPizzaRem]--;
            
PlayerInfo[playerid][pPizzaTimes]++;
            
Update(playerid,pPizzaRemx);
            
Update(playerid,pPizzaTimesx);
            
GivePlayerCash(playerid,pizzaprize[playerid]);
            
Update(playeridpCashx);
            
pizzaprize[playerid] = 0;
            if(
PlayerInfo[playerid][pPizzaSkill] <= 5)
            {
            if(
PlayerInfo[playerid][pPizzaRem] <= 0)
            {
                
PlayerInfo[playerid][pPizzaSkill]++;
                   if(
PlayerInfo[playerid][pPizzaSkill] == 2)
                {
                    
PlayerInfo[playerid][pPizzaRem] = 34;
                }
                else if(
PlayerInfo[playerid][pPizzaSkill] == 3)
                {
                    
PlayerInfo[playerid][pPizzaRem] = 49;
                }
                else if(
PlayerInfo[playerid][pPizzaSkill] == 4)
                {
                    
PlayerInfo[playerid][pPizzaRem] = 89;
                }
                else if(
PlayerInfo[playerid][pPizzaSkill] == 5)
                {
                    
PlayerInfo[playerid][pPizzaRem] = 99;
                }
                
Update(playerid,pPizzaSkillx);
                
Update(playerid,pPizzaRemx);
                new 
stringe[128];
                
format(string,sizeof(string),"Felicitari! Ai acum skill %d pentru acest job!",PlayerInfo[playerid][pPizzaSkill]);
                
format(stringe,sizeof(stringe),"Congratulations! Now you have skill %d for this job!",PlayerInfo[playerid][pPizzaSkill]);
                
SS(playeridCOLOR_YELLOWstringstringe);
            }
        }
    }
    }
    return 
1;

Reply
#4

ty <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)