Pawno Crash
#1

Not sure what i'm doing wrong here :/

PHP код:
else if(RegistrationStep[playerid] == 2)
        {
            if 
PlayerInfo[playerid][pAccent] = 0;
            {
                
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}So, what accent would you like to have? (Fill in the number)");
                   
SendClientMessageEx(playeridCOLOR_WHITE"Normal [1] British[2] American[3] Gangsta[4] Italian [5]");
            }
                  if (
strcmp("1"texttrue) == 0)
                 {
                    
PlayerInfo[playerid][pAccent] = 1;
                    
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'Normal'");
                    
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                    
RegistrationStep[playerid] = 3;
                    return 
0;
                }
                else if (
strcmp("2"texttrue) == 0)
                {
                    
PlayerInfo[playerid][pAccent] = 2;
                    
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'British'");
                    
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                    
RegistrationStep[playerid] = 3;
                    return 
0;
                }
                else if (
strcmp("3"texttrue) == 0)
                {
                    
PlayerInfo[playerid][pAccent] = 9;
                    
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'American'");
                    
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                    
RegistrationStep[playerid] = 3;
                    return 
0;
                }
                else if (
strcmp("4"texttrue) == 0)
                {
                    
PlayerInfo[playerid][pAccent] = 14;
                    
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'Gangsta'");
                    
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                    
RegistrationStep[playerid] = 3;
                    return 
0;
                }
                else if (
strcmp("5"texttrue) == 0)
                {
                    
PlayerInfo[playerid][pAccent] = 13;
                    
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'Italian'");
                    
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                    
RegistrationStep[playerid] = 3;
                    return 
0;
                }
                else
                   {
                       
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}So, what accent would you like to have? (Fill in the number)");
                       
SendClientMessageEx(playeridCOLOR_WHITE"Normal [1] British[2] American[3] Gangsta[4] Italian [5]");
                }
            }
        }
        return 
0;
    } 
Reply
#2

What Error you get? can you show me
Reply
#3

It gives no error, it just sais pawno doesen't work anymore something like that and closes itself.
Reply
#4

Changed it to this and now i got errors and warnings.

PHP код:
else if(RegistrationStep[playerid] == 2)
     {
          if 
PlayerInfo[playerid][pAccent] = 0;
        {
             
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}So, what accent would you like to have? (Fill in the number)");
               
SendClientMessageEx(playeridCOLOR_WHITE"Normal [1] British[2] American[3] Gangsta[4] Italian [5]");
           }
            if (
strcmp("1"texttrue) == 0)
             {
                  
PlayerInfo[playerid][pAccent] = 1;
                
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'Normal'");
                
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                
RegistrationStep[playerid] = 3;
                 return 
0;
            }
            else if (
strcmp("2"texttrue) == 0)
            {
                
PlayerInfo[playerid][pAccent] = 2;
                 
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'British'");
                  
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                   
RegistrationStep[playerid] = 3;
                return 
0;
             }
             else if (
strcmp("3"texttrue) == 0)
             {
                
PlayerInfo[playerid][pAccent] = 9;
                   
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'American'");
                
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                
RegistrationStep[playerid] = 3;
                return 
0;
             }
             else if (
strcmp("4"texttrue) == 0)
             {
                   
PlayerInfo[playerid][pAccent] = 14;
                 
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'Gangsta'");
                 
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                 
RegistrationStep[playerid] = 3;
                 return 
0;
             }
             else if (
strcmp("5"texttrue) == 0)
             {
                   
PlayerInfo[playerid][pAccent] = 13;
                   
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'Italian'");
                
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                
RegistrationStep[playerid] = 3;
                return 
0;
             }
             else
             {
                 
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}So, what accent would you like to have? (Fill in the number)");
                  
SendClientMessageEx(playeridCOLOR_WHITE"Normal [1] British[2] American[3] Gangsta[4] Italian [5]"); {
            }
        }
        return 
0;
    } 
Quote:

C:\Users\Bart\Downloads\samp03dsvr_R2_win32\gamemo des\lsrp.pwn(69044) : warning 211: possibly unintended assignment
C:\Users\Bart\Downloads\samp03dsvr_R2_win32\gamemo des\lsrp.pwn(69044) : error 001: expected token: "*then", but found ";"
C:\Users\Bart\Downloads\samp03dsvr_R2_win32\gamemo des\lsrp.pwn(69044) : error 036: empty statement
C:\Users\Bart\Downloads\samp03dsvr_R2_win32\gamemo des\lsrp.pwn(69049) : warning 217: loose indentation
C:\Users\Bart\Downloads\samp03dsvr_R2_win32\gamemo des\lsrp.pwn(69095) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Reply
#5

pawn Код:
if PlayerInfo[playerid][pAccent] = 0;
You are doing it wrong here. You are setting the value instead of checking it and no brackets and u are just closing it by using ';'. Its goes like this:

pawn Код:
if(PlayerInfo[playerid][pAccent] == 0)
Reply
#6

Okay, thanks changed it to this now.


PHP код:
else if(RegistrationStep[playerid] == 2)
     {
          if(
PlayerInfo[playerid][pAccent] == 0)
        {
             
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}So, what accent would you like to have? (Fill in the number)");
               
SendClientMessageEx(playeridCOLOR_WHITE"Normal [1] British[2] American[3] Gangsta[4] Italian [5]");
           }
            if (
strcmp("1"texttrue) == 0)
             {
                  
PlayerInfo[playerid][pAccent] = 1;
                
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'Normal'");
                
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                
RegistrationStep[playerid] = 3;
                 return 
0;
            }
            else if (
strcmp("2"texttrue) == 0)
            {
                
PlayerInfo[playerid][pAccent] = 2;
                 
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'British'");
                  
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                   
RegistrationStep[playerid] = 3;
                return 
0;
             }
             else if (
strcmp("3"texttrue) == 0)
             {
                
PlayerInfo[playerid][pAccent] = 9;
                   
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'American'");
                
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                
RegistrationStep[playerid] = 3;
                return 
0;
             }
             else if (
strcmp("4"texttrue) == 0)
             {
                   
PlayerInfo[playerid][pAccent] = 14;
                 
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'Gangsta'");
                 
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                 
RegistrationStep[playerid] = 3;
                 return 
0;
             }
             else if (
strcmp("5"texttrue) == 0)
             {
                   
PlayerInfo[playerid][pAccent] = 13;
                   
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}Alright, your accent has been changed to 'Italian'");
                
SendClientMessageEx(playeridCOLOR_WHITE"You can change your accent at any time ingame with /accent.");
                
RegistrationStep[playerid] = 3;
                return 
0;
             }
             else
             {
                 
SendClientMessageEx(playeridCOLOR_GREY"(Registration): {FFFFFF}So, what accent would you like to have? (Fill in the number)");
                  
SendClientMessageEx(playeridCOLOR_WHITE"Normal [1] British[2] American[3] Gangsta[4] Italian [5]"); {
            }
        }
        return 
0;
    } 
Quote:

C:\Users\Bart\Downloads\samp03dsvr_R2_win32\gamemo des\lsrp.pwn(69049) : warning 217: loose indentation
C:\Users\Bart\Downloads\samp03dsvr_R2_win32\gamemo des\lsrp.pwn(69095) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.

Line 69049
PHP код:
if (strcmp("1"texttrue) == 0
Line 69095
PHP код:
return 0
Reply
#7

Loose indentations are mostly due to unequal spaces tabs for the line 69049 just enter a space before 'if'.
Reply
#8

Didn't work, also the php thingy makes it look wrong here. it looks diffrent in my pawno
Reply
#9

Use [pawn][./pawn] tags.
Reply
#10

Use TAB to indent your code like so:

pawn Код:
public callback()
{
    new var;
    if(condition)
    {
        function();
        var = 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)