Some warning help
#1

I can't get rid of those warning maybe you guys can help me out?, thanks in advance!

Код:
C:\Users\Magnus\Desktop\Scrath rp\gamemodes\grandlarc.pwn(2773) : warning 215: expression has no effect
C:\Users\Magnus\Desktop\Scrath rp\gamemodes\grandlarc.pwn(2774) : warning 215: expression has no effect
C:\Users\Magnus\Desktop\Scrath rp\gamemodes\grandlarc.pwn(2775) : warning 215: expression has no effect
C:\Users\Magnus\Desktop\Scrath rp\gamemodes\grandlarc.pwn(2776) : warning 215: expression has no effect
C:\Users\Magnus\Desktop\Scrath rp\gamemodes\grandlarc.pwn(2777) : warning 215: expression has no effect
C:\Users\Magnus\Desktop\Scrath rp\gamemodes\grandlarc.pwn(2778) : warning 215: expression has no effect
PHP код:
if(dialogid == DIALOG_BUYMOBILE2// aka 128
    
{
        if(
response)
        {
            new 
string[128], number[50];
               switch(
listitem)
              {
                case 
0PlayerInfo[playerid][pPhoneNumber], GetPVarInt(playerid,"Num1"), format(number50"%s"GetPVarInt(playerid,"Num1"));
                  case 
1PlayerInfo[playerid][pPhoneNumber], GetPVarInt(playerid,"Num2"), format(number50"%s"GetPVarInt(playerid,"Num2"));
                case 
2PlayerInfo[playerid][pPhoneNumber], GetPVarInt(playerid,"Num3"), format(number50"%s"GetPVarInt(playerid,"Num3"));
                 case 
3PlayerInfo[playerid][pPhoneNumber], GetPVarInt(playerid,"Num4"), format(number50"%s"GetPVarInt(playerid,"Num4"));
                  case 
4PlayerInfo[playerid][pPhoneNumber], GetPVarInt(playerid,"Num5"), format(number50"%s"GetPVarInt(playerid,"Num5"));
                   case 
5PlayerInfo[playerid][pPhoneNumber], GetPVarInt(playerid,"Num6"), format(number50"%s"GetPVarInt(playerid,"Num6"));
            }
               
format(string128"Number set to '%s'."number);
              
SendClientMessage(playeridCOLOR_WHITEstring);
            
DeletePVar(playerid"Num1");
             
DeletePVar(playerid"Num2");
             
DeletePVar(playerid"Num3");
             
DeletePVar(playerid"Num4");
             
DeletePVar(playerid"Num5");
             
DeletePVar(playerid"Num6");
           }
    } 
Reply
#2

You're not showing us any warnings, but they're probably being caused by
Код:
switch(listitem)
Because you're using integers with the cases.

Use
Код:
switch (strval(listitem))
Reply
#3

Quote:
Originally Posted by Stinged
Посмотреть сообщение
You're not showing us any warnings, but they're probably being caused by
Код:
switch(listitem)
Because you're using integers with the cases.

Use
Код:
switch (strval(listitem))
I get this then

Код:
C:\Users\Magnus\Desktop\Scrath rp\gamemodes\grandlarc.pwn(2772) : error 035: argument type mismatch (argument 1)
Reply
#4

Let's take this line as an example:
pawn Код:
case 0: PlayerInfo[playerid][pPhoneNumber], GetPVarInt(playerid,"Num1"), format(number, 50, "%s", GetPVarInt(playerid,"Num1"));
What you're basically doing is:
Код:
PlayerInfo[playerid][pPhoneNumber];
GetPVarInt(playerid,"Num1");
format(number, 50, "%s", GetPVarInt(playerid,"Num1"));
Those two lines (marked with red) have no effect like the warnings indicate, do they? Think again of what you are trying to do.

@Stinged: Confused with "inputtext".
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Let's take this line as an example:
pawn Код:
case 0: PlayerInfo[playerid][pPhoneNumber], GetPVarInt(playerid,"Num1"), format(number, 50, "%s", GetPVarInt(playerid,"Num1"));
What you're basically doing is:
Код:
PlayerInfo[playerid][pPhoneNumber];
GetPVarInt(playerid,"Num1");
format(number, 50, "%s", GetPVarInt(playerid,"Num1"));
Those two lines (marked with red) have no effect like the warnings indicate, do they? Think again of what you are trying to do.

@Stinged: Confused with "inputtext".
Thanks dude i just realize what i was doing wrong lol.
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Let's take this line as an example:@Stinged: Confused with "inputtext".
Oh damn, sorry..
I can't believe I mixed up between them lol..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)