SA-MP Forums Archive
Problem with 2 actions in one case - 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: Problem with 2 actions in one case (/showthread.php?tid=508368)



Problem with 2 actions in one case - Lirbo - 21.04.2014

I can't do 2 actions in one case... what i need to do?
pawn Код:
if(dialogid == 5){
    if(response)
    switch(listitem){
    case 0: DOF2_SetInt(RFile(playerid),"Money", DOF2_GetInt(RFile(playerid), "Money")-2500); GivePlayerWeapon(playerid,22,99999);
    case 1: DOF2_SetInt(RFile(playerid),"Money", DOF2_GetInt(RFile(playerid), "Money")-5000); GivePlayerWeapon(playerid,24,75);
    case 3: DOF2_SetInt(RFile(playerid),"Money", DOF2_GetInt(RFile(playerid), "Money")-7500); GivePlayerWeapon(playerid,25,80);
    case 4: DOF2_SetInt(RFile(playerid),"Money", DOF2_GetInt(RFile(playerid), "Money")-10000); GivePlayerWeapon(playerid,29,250);
    case 5: DOF2_SetInt(RFile(playerid),"Money", DOF2_GetInt(RFile(playerid), "Money")-12000); GivePlayerWeapon(playerid,30,250);
    case 6: DOF2_SetInt(RFile(playerid),"Money", DOF2_GetInt(RFile(playerid), "Money")-15000); GivePlayerWeapon(playerid,33,40);
    case 7: DOF2_SetInt(RFile(playerid),"Money", DOF2_GetInt(RFile(playerid), "Money")-12000); GivePlayerWeapon(playerid,34,50);}}



Re: Problem with 2 actions in one case - Vince - 21.04.2014

Put braces around it, like every other block of code.


Re: Problem with 2 actions in one case - Lirbo - 21.04.2014

Quote:
Originally Posted by Vince
Посмотреть сообщение
Put braces around it, like every other block of code.
Thanks