SA-MP Forums Archive
[SAP] OPEN ME ! - 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: [SAP] OPEN ME ! (/showthread.php?tid=621417)



[SAP] OPEN ME ! - Yaa - 10.11.2016

Hey !

Errors :

PHP код:
D:\pawno-master\include\SAPData/Gameplay/Duel.pwn(694) : error 008must be a constant expressionassumed zero
D
:\pawno-master\include\SAPData/Gameplay/Duel.pwn(697) : error 008must be a constant expressionassumed zero
D
:\pawno-master\include\SAPData/Gameplay/Duel.pwn(700) : error 008must be a constant expressionassumed zero
D
:\pawno-master\include\SAPData/Gameplay/Duel.pwn(703) : error 008must be a constant expressionassumed zero 
Code:

PHP код:
CMD:declineduel(playeridparams[])
{
    
SendClientMessage(playeridCOLOR_RED"You decline the duel inventation");
    
SendClientMessage(Inventation[playerid], COLOR_RED"your duel inventation got declined.");
    
Inventation[InventationSent[playerid]] = -1;
    
InventationSent[playerid] = -1;
    switch(
playerid)
    {
        case 
DualRoom1: <-- 694
        DualRoom1 
= -1;
        
        case 
DualRoom2: <-- 697
        DualRoom2 
= -1;
        
        case 
DualRoom3: <-- 700
        DualRoom3 
= -1;
        
        case 
DualRoom4: <-- 703
        DualRoom4 
= -1;
        
    }
    return 
1;

Thanks
Yaa


Re: [SAP] OPEN ME ! - mkr - 10.11.2016

Код:
case DualRoom1: <-- 694
Is the <-- 694 part of that supposed to be a comment or what?

I suspect if you remove that part and the three other ones below it, it'll compile.


Re: [SAP] OPEN ME ! - Yaa - 10.11.2016

wtf i added this comments <-- *** for define the lines :/

the origine code without it


Re: [SAP] OPEN ME ! - JulieG - 10.11.2016

Where does playerid = DualRoom1/2/3/4 is define ?


Re: [SAP] OPEN ME ! - Gammix - 10.11.2016

My guess "DualRoom" are variables and as the error says, switch statements cannot have varying cases. You can compare non-constant variables using if-else.

Or if those variables hold constant values, use #define or enum.


Re: [SAP] OPEN ME ! - Yaa - 10.11.2016

new DualRoom1; <--
new DualRoom2; <--
new DualRoom3; <--
new DualRoom4; <--

Defines ^^


Re: [SAP] OPEN ME ! - LeonRP - 10.11.2016

switch(playerid)
{
case DualRoom1: <-- 694
DualRoom1 = -1;

case DualRoom2: <-- 697
DualRoom2 = -1;

case DualRoom3: <-- 700
DualRoom3 = -1;

case DualRoom4: <-- 703
DualRoom4 = -1;

}

This script says if( playerid= DualRoom1){DualRoom1=-1} etc. So to work you need to make a playerid = DualRoom1/2/3/4


Re: [SAP] OPEN ME ! - Yaa - 10.11.2016

what do you mean ?

and just a notice i got this error after updating YSI To lastest version


Re: [SAP] OPEN ME ! - Pearson - 10.11.2016

REMOVED