changeskin?
#1

Код:
../gamemodes/include/OnCommand.pwn(6) : error 014: invalid statement; not in switch
../gamemodes/include/OnCommand.pwn(6) : warning 215: expression has no effect
../gamemodes/include/OnCommand.pwn(6) : warning 215: expression has no effect
../gamemodes/include/OnCommand.pwn(6) : warning 215: expression has no effect
../gamemodes/include/OnCommand.pwn(6) : warning 215: expression has no effect
../gamemodes/include/OnCommand.pwn(6) : error 001: expected token: ";", but found ":"
../gamemodes/include/OnCommand.pwn(6) : error 029: invalid expression, assumed zero
../gamemodes/include/OnCommand.pwn(6) : fatal error 107: too many error messages on one line

PHP код:
CMD:changeskin(playerid// CMD for calling a change skin
{
    case 
0,1,2,3://GROVE
    
{
        if(
classid == || classid == || classid == 2)
        {
            
ShowModelSelectionMenu(playeridskingrove"Select skin for grove");
        }
    }
     case 
4,5,6://LSPD
      
{
          if(
classid == || classid == || classid == || classid == 6)
        {
             
ShowModelSelectionMenu(playeridskinpolice"Select skin for police");
           }
     }
     case 
7,8,9://VAGOS
     
{
        if(
classid == || classid == || classid == 9)
         {
             
ShowModelSelectionMenu(playeridskingrove"Select skin for vagos");
          }
    }
     case 
10,11,12,13://BALLAS
      
{
        if(
classid == 10 || classid == 11 || classid == 12)
        {
            
ShowModelSelectionMenu(playeridskinballas"Select skin for grove");
            return 
1;
        }
    }

Reply
#2

pawn Код:
switch(something)
{
    case 0:
    {
        // ...
    }
    case 1:
    {
        // ...
    }
}
Reply
#3

Quote:
Originally Posted by Kevln
Посмотреть сообщение
pawn Код:
switch(something)
{
    case 0:
    {
        // ...
    }
    case 1:
    {
        // ...
    }
}
ops i forgot the switch.
Reply
#4

I get this now lol

PHP код:
../gamemodes/include/OnCommand.pwn(6) : error 017undefined symbol "classid"
../gamemodes/include/OnCommand.pwn(10) : error 017undefined symbol "classid"
../gamemodes/include/OnCommand.pwn(17) : error 017undefined symbol "classid"
../gamemodes/include/OnCommand.pwn(24) : error 017undefined symbol "classid"
../gamemodes/include/OnCommand.pwn(31) : error 017undefined symbol "classid" 
Reply
#5

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
I get this now lol

PHP код:
../gamemodes/include/OnCommand.pwn(6) : error 017undefined symbol "classid"
../gamemodes/include/OnCommand.pwn(10) : error 017undefined symbol "classid"
../gamemodes/include/OnCommand.pwn(17) : error 017undefined symbol "classid"
../gamemodes/include/OnCommand.pwn(24) : error 017undefined symbol "classid"
../gamemodes/include/OnCommand.pwn(31) : error 017undefined symbol "classid" 
You're comparing a variable that doesn't even exist.
Reply
#6

Yea as KevLn said - that variable doesn't exist within the command.

You'll have to save the class ID into an array when the player chooses class, then use that value later
E.g.

New array

PHP код:
new PlayerClass[MAX_PLAYERS]; 
Saving the class:

PHP код:
public OnPlayerRequestClass(playerid,classid)
{
    
PlayerClass[playerid] = classid;

Using in your switch (create local variable classid and read from the array):

PHP код:
new classid PlayerClass[Playerid];
 
switch(
classid)
{
    case 
0,1,2,3://GROVE 
        

            if(
classid == || classid == || classid == 2
            { 
                
ShowModelSelectionMenu(playeridskingrove"Select skin for grove"); 
            } 
        }

Hope this helps
Reply
#7

Why not a team variable, rather than checking classid via the if statements?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)