Namechange problem
#1

Hey all. I have a problem with my changename script.

This dialog should change my pScreenName variable

pawn Код:
case DIALOG_CHANGENAME:
        {

            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, ""COL_WHITE"Email",""COL_RED"You have entered an invalid name.\n"COL_WHITE"Fill in your new name below. You're login name will be the same.\n This is just your screen-name.","Activate","Quit");
                SetPlayerName(playerid,inputtext);
                PlayerInfo[playerid][pScreenName] = inputtext[20];
                ShowPlayerDialog(playerid, DIALOG_CHANGENAMESUC, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_WHITE"You have {00FF22}successfully{FFFFFF} changed your name.","Ok","");
            }
            return 1;
        }
It does set the name but not in the variable

This is my stats string:

pawn Код:
format(String,sizeof(String),"\nMoney: %d\nControl Panel Used: %d\nScreen Name: %s",PlayerInfo[playerid][pCash],PlayerInfo[playerid][pCpUse],PlayerInfo[playerid][pScreenName]);
The Screen Name keeps being blanc. No errors or warnings.
What could be the problem now?

Update:
I know noticed that this line crashes my command:
PlayerInfo[playerid][pScreenName] = inputtext[20];

What could it be?
Reply
#2

you have to format it like a string;

format(PlayerInfo[playerid][pScreenName],25,inputtet);
Reply
#3

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
you have to format it like a string;

format(PlayerInfo[playerid][pScreenName],25,inputtet);
I know noticed that this line crashes my command:
PlayerInfo[playerid][pScreenName] = inputtext[20];
Reply
#4

Does anyone know it? I prefer having it fixed before I'm in bed
Reply
#5

try my think because my dialog response works with this

make sure you have in your enum pSreenName[25]
Reply
#6

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
try my think because my dialog response works with this

make sure you have in your enum pSreenName[25]
I did. There is [25] in my enum
Reply
#7

pawn Код:
format(PlayerInfo[playerid][pScreenName], sizeof(PlayerInfo[playerid][pScreenName]), inputtext);
Reply
#8

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
format(PlayerInfo[playerid][pScreenName], sizeof(PlayerInfo[playerid][pScreenName]), inputtext);
pawn Код:
C:\Users\Lars\Desktop\Sa-mp\gamemodes\RPG.pwn(464) : error 001: expected token: "]", but found "-identifier-"
C:\Users\Lars\Desktop\Sa-mp\gamemodes\RPG.pwn(464) : warning 215: expression has no effect
C:\Users\Lars\Desktop\Sa-mp\gamemodes\RPG.pwn(464) : error 001: expected token: ";", but found "]"
C:\Users\Lars\Desktop\Sa-mp\gamemodes\RPG.pwn(464) : error 029: invalid expression, assumed zero
C:\Users\Lars\Desktop\Sa-mp\gamemodes\RPG.pwn(464) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#9

hmm try
format(PlayerInfo[playerid][pScreenName], sizeof 25,inputtext);
Reply
#10

Quote:
Originally Posted by Tigerkiller
Посмотреть сообщение
hmm try
format(PlayerInfo[playerid][pScreenName], sizeof 25,inputtext);
Gives me another error:

Код:
C:\Users\Lars\Desktop\Sa-mp\gamemodes\RPG.pwn(464) : error 020: invalid symbol name ""
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)