What am I doing wrong here?
#1

pawn Код:
Player[playerid][GlobalName] = strval(inputtext);
             
             format(Query, sizeof(Query), "UPDATE db_players SET Username = '%q' WHERE Username = '%q'", inputtext, Player[playerid][GlobalName]);
             db_query(PlayersDB, Query);
             
             
             format(string, sizeof(string), "Your new name is: %s", inputtext);
             ShowPlayerDialog(playerid, D_INFO, DIALOG_STYLE_MSGBOX, "Name changed!", string, "Confirm", "Cancel");
             
             SetPlayerName(playerid, inputtext);
Код:
[02:04:59] [db_log_queries]: UPDATE db_players SET Username = 'fazr' WHERE Username = ''
Reply
#2

https://sampwiki.blast.hk/wiki/Strval
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
silly me

but you see what I'm trying to do right? If not,

I'm trying to update the globalname variable with the inputtext before updating the db
but I've forgotten how to do it.
Reply
#4

You need update globalname after format not before

pawn Код:
strcat((Player[playerid][GlobalName][0]='\0',Player[playerid][GlobalName]),inputtext,MAX_PLAYER_NAME);
Reply
#5

Quote:
Originally Posted by Jefff
Посмотреть сообщение
You need update globalname after format not before

pawn Код:
strcat((Player[playerid][GlobalName][0]='\0',Player[playerid][GlobalName]),inputtext,MAX_PLAYER_NAME);
Thank you.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)