SA-MP Forums Archive
Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (/showthread.php?tid=363609)



Help - TheDeath - 28.07.2012

Can someone tell me why this update query don't wanna work??
pawn Код:
new Query[128],money[8],Float:X[10],FLoat:Y[10],Float:Z[10],SelectedSkin[10],CurrentSkin[10];
    format(Query,sizeof(Query),"SELECT * FROM `users` WHERE username = '%s' LIMIT 1",PlayerName(playerid));
    mysql_query(Query);
    mysql_store_result();
    mysql_retrieve_row();
    mysql_get_field("Money",money);
    mysql_get_field("SelectedSkin",SelectedSkin);
    mysql_get_field("CurrentSkin",CurrentSkin);
    mysql_get_field("X",X);
    mysql_get_field("Y",Y);
    mysql_get_field("Z",Z);
    SetPlayerPos(playerid, strval(X), strval(Y), strval(Z)+1);
    if(strval(SelectedSkin) == 0){
    format(Query,sizeof(Query),"UPDATE `users` SET SelectedSkin='1',DefaultSki='%s',CurrentSki='%s' WHERE username = '%s'",GetPlayerSkin(playerid),GetPlayerSkin(playerid),PlayerName(playerid));
    mysql_query(Query);
    }
    else{
    SetPlayerSkin(playerid,strval(CurrentSkin));
    }
    SetPlayerMoney(playerid,strval(money));
    mysql_free_result();