stock ChooseDialog ( dialogid , playerid ) {
switch ( dialogid ) {
case DIALOG_REG: {
strcat ( mstr , ""YELLOW"This server using MySQL Cookie System that "RED"made by Mubarrak48\n" ) ;
strcat ( mstr , ""YELLOW"If you want to see more feature you can register on our "RED"database\n" ) ;
strcat ( mstr , ""YELLOW"Click "RED"Yes "YELLOW"to register on ourdatabase or\n" ) ;
strcat ( mstr , ""YELLOW"You can click "RED"No "YELLOW"to continue without registering\n" ) ;
ShowPlayerDialog ( playerid , DIALOG_REG , DIALOG_STYLE_MSGBOX , DIALOG_TITLE , mstr , "Yes" , "No" ) ;
}
}
return 1 ;
}
public OnPlayerConnect ( playerid ) {
GetPlayerName ( playerid , iName , sizeof ( iName ) ) ;
mysql_real_escape_string ( iName , iName ) ;
format ( Query , sizeof ( Query ) , "SELECT * FROM `users` WHERE `username` = '%s'" , iName ) ;
mysql_query ( Query ) ;
mysql_store_result ( ) ;
if ( mysql_num_rows ( ) == 0 ) {
ChooseDialog ( DIALOG_REG , playerid ) ;
}
else {
new
Cookies [ 1 ] ;
if ( mysql_fetch_row ( Query ) ) {
sscanf ( Query , "p<|>i" , Cookies [ 0 ] ) ;
SetPVarInt ( playerid , "Cookies" , Cookies [ 0 ] ) ;
SetPVarInt ( playerid , "Logged" , 1 ) ;
}
format ( str , sizeof ( str ) , ""YELLOW"Welcome back "RED"%s, "YELLOW"Your Amounts of "RED"cookies "YELLOW"are "RED"%i Cookie(s)" , iName , GetPVarInt ( playerid , "Cookies" ) ) ;
SendClientMessage ( playerid , -1 , str ) ;
}
mysql_free_result ( ) ;
return 1 ;
}
format( mstr , ""YELLOW"This server using MySQL Cookie System that "RED"made by Mubarrak48\n" ) ;
Код:
format( mstr , ""YELLOW"This server using MySQL Cookie System that "RED"made by Mubarrak48\n" ) ; using strcat at start, then it adds the dialog-string to the (still filled) old string i guess (assuming the mstr is global, which is obviously the case ) |
stock ChooseDialog ( dialogid , playerid ) {
switch ( dialogid ) {
case DIALOG_REG: {
mstr = "";
strcat ( mstr , ""YELLOW"This server using MySQL Cookie System that "RED"made by Mubarrak48\n" ) ;
strcat ( mstr , ""YELLOW"If you want to see more feature you can register on our "RED"database\n" ) ;
strcat ( mstr , ""YELLOW"Click "RED"Yes "YELLOW"to register on ourdatabase or\n" ) ;
strcat ( mstr , ""YELLOW"You can click "RED"No "YELLOW"to continue without registering\n" ) ;
ShowPlayerDialog ( playerid , DIALOG_REG , DIALOG_STYLE_MSGBOX , DIALOG_TITLE , mstr , "Yes" , "No" ) ;
}
}
return 1 ;
}