question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: question (
/showthread.php?tid=654249)
question -
enzulikeS - 24.05.2018
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
Re: question -
enzulikeS - 26.05.2018
help
Re: question -
Lokii - 26.05.2018
you missed 1 bracket
heres the fix:
PHP код:
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;
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;
}
Re: question -
enzulikeS - 26.05.2018
ty <3