pawn Код:
public OnJoueurRenommer ( playerid, id, name )
{
printf ( "1" ) ;
new query [ 128 ] , name2 [ MAX_PLAYER_NAME ] ;
if ( cache_get_row_count ( ) ) return SendClientMessage ( playerid, Red, "This player is already in the database." ) ;
GetPlayerName ( playerid, joueuremetteur, sizeof ( joueuremetteur ) ) ;
GetPlayerName ( id, name2, sizeof ( name2 ) ) ;
printf ( "2" ) ;
new v1 = pInfo [ id ] [ ClefVoiture1 ] , v2 = pInfo [ id ] [ ClefVoiture2 ] , v3 = pInfo [ id ] [ ClefVoiture3 ] , v4 = pInfo [ id ] [ ClefVoiture4 ] ;
printf ( "3" ) ;
if ( pInfo [ id ] [ ClefVoiture1 ] ! = 1 )
{
size ( vInfo [ v1 ] [ vProprietaire ] , MAX_PLAYER_NAME, "% s" , joueurdestinataire ) ;
Format ( query, sizeof ( query ) , "UPDATE` cars `SET` Owner `= '% s' WHERE` ID `=% d" , joueurdestinataire, vInfo [ v1 ] [ vID ] ) ;
mysql_tquery ( mysql, query, "" , "" ) ;
}
printf ( "3-2" ) ;
if ( pInfo [ id ] [ ClefVoiture2 ] ! = 1 )
{
size ( vInfo [ v2 ] [ vProprietaire ] , MAX_PLAYER_NAME, "% s" , joueurdestinataire ) ;
Format ( query, sizeof ( query ) , "UPDATE` cars `SET` Owner `= '% s' WHERE` ID `=% d" , joueurdestinataire, vInfo [ v2 ] [ vID ] ) ;
mysql_tquery ( mysql, query, "" , "" ) ;
}
printf ( "3-3" ) ;
if ( pInfo [ id ] [ ClefVoiture3 ] ! = 1 )
{
size ( vInfo [ v3 ] [ vProprietaire ] , MAX_PLAYER_NAME, "% s" , joueurdestinataire ) ;
Format ( query, sizeof ( query ) , "UPDATE` cars `SET` Owner `= '% s' WHERE` ID `=% d" , joueurdestinataire, vInfo [ v3 ] [ vID ] ) ;
mysql_tquery ( mysql, query, "" , "" ) ;
}
printf ( "3-4" ) ;
if ( pInfo [ id ] [ ClefVoiture4 ] ! = 1 )
{
size ( vInfo [ v4 ] [ vProprietaire ] , MAX_PLAYER_NAME, "% s" , joueurdestinataire ) ;
Format ( query, sizeof ( query ) , "UPDATE` cars `SET` Owner `= '% s' WHERE` ID `=% d" , joueurdestinataire, vInfo [ v4 ] [ vID ] ) ;
mysql_tquery ( mysql, query, "" , "" ) ;
}
printf ( "4" ) ;
if ( pInfo [ id ] [ ClefMaison ] =! - 1 )
{
new m = pInfo [ id ] [ ClefMaison ] ;
size ( MINFO [ pInfo [ id ] [ ClefMaison ] ] [ mProprietaire ] , MAX_PLAYER_NAME, "% s" , joueurdestinataire ) ;
Format ( query, sizeof ( query ) , "UPDATE` houses `SET` Owner `= '% s' WHERE` ID `=% d" , joueurdestinataire, pInfo [ id ] [ ClefMaison ] ) ;
mysql_tquery ( mysql, query, "" , "" ) ;
ConfigurerMaison ( m, MINFO [ m ] [ mAchetee ] ) ;
}
if ( pInfo [ id ] [ ClefLocationMaison ] =! - 1 )
{
new m = pInfo [ id ] [ ClefLocationMaison ] ;
size ( MINFO [ pInfo [ id ] [ ClefLocationMaison ] ] [ mProprietaire ] , MAX_PLAYER_NAME, "% s" , joueurdestinataire ) ;
Format ( query, sizeof ( query ) , "UPDATE` houses `SET` Tenant `= '% s' WHERE` ID `=% d" , joueurdestinataire, pInfo [ id ] [ ClefLocationMaison ] ) ;
mysql_tquery ( mysql, query, "" , "" ) ;
ConfigurerMaison ( m, MINFO [ m ] [ mAchetee ] ) ;
}
printf ( "5" ) ;
Format ( query, sizeof ( query ) , "UPDATE` players `SET` username `= '% s' WHERE` ID `=% d" , joueurdestinataire, pInfo [ id ] [ ID ] ) ;
mysql_tquery ( mysql, query, "" , "" ) ;
printf ( "6" ) ;
Format ( query, sizeof ( query ) , "[ADMIN]:% s to rename% s to% s." , joueuremetteur, name2, joueurdestinataire ) ;
ChannelAdmin ( Red, query ) ;
printf ( "7" ) ;
Format ( query, sizeof ( query ) , "% s changed your name to% s." , joueuremetteur, joueurdestinataire ) ;
SendClientMessage ( id, LightBlue, query ) ;
printf ( "8" ) ;
SetPlayerName ( id, joueurdestinataire ) ;
printf ( "9" ) ;
return 1 ;
}
LEARN MYSQL. You're not doing it right.