SA-MP Forums Archive
Help with mysql Skins - 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 with mysql Skins (/showthread.php?tid=363528)



Help with mysql Skins - TheDeath - 27.07.2012

Whats wrong with this code. i have set DefaultSkin to 1 and CurrentSkin to 100 and it dont wanna show the MotorGuy(Skin:100)
pawn Код:
SetPlayerPos(playerid, -2026.6865, 156.8029, 29.0456);
    SetPlayerCameraPos(playerid, -2021.6796, 156.3540, 29.3975);
    SetPlayerCameraLookAt(playerid, -2026.6865, 156.8029, 29.0456);
    SetPlayerFacingAngle(playerid,275);
    new Query[128],DefaultSkin[8],CurrentSkin[8];
    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("DefaultSkin",DefaultSkin);
    mysql_get_field("CurrentSkin",CurrentSkin);
    if(strval(DefaultSkin) == 0){
    AddPlayerClass(29, -2026.6865, 156.8029, 29.0456, 0, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(10, -2026.6865, 156.8029, 29.0456, 0, 0, 0, 0, 0, 0, 0);
    }
    else{
    AddPlayerClass(CurrentSkin, -2026.6865, 156.8029, 29.0456, 0, 0, 0, 0, 0, 0, 0);
    }
    SetPlayerFacingAngle(playerid,275);
    mysql_free_result();



Re: Help with mysql Skins - Kitten - 27.07.2012

Why are you using AddPlayerClass?

Just load the variable off the database and use SetPlayerSkin(playerid,CurrentSkin); when the player spawns.


Re: Help with mysql Skins - TheDeath - 27.07.2012

I want if he spawns for first time to be able to chose him class...


Re: Help with mysql Skins - TheDeath - 28.07.2012

Can someone tell me what is wrong with this code
pawn Код:
SetPlayerPos(playerid, -2026.6865, 156.8029, 29.0456);
    SetPlayerCameraPos(playerid, -2021.6796, 156.3540, 29.3975);
    SetPlayerCameraLookAt(playerid, -2026.6865, 156.8029, 29.0456);
    SetPlayerFacingAngle(playerid,275);
    new Query[128],DefaultSkin[8],CurrentSkin[8];
    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("DefaultSkin",DefaultSkin);
    mysql_get_field("CurrentSkin",CurrentSkin);
    printf("DefaultSkin %d" , strval(DefaultSkin));
    printf("CurrentSkin %d" , strval(CurrentSkin));
    if(strval(DefaultSkin) == 0){
    AddPlayerClass(29, -2026.6865, 156.8029, 29.0456, 0, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(10, -2026.6865, 156.8029, 29.0456, 0, 0, 0, 0, 0, 0, 0);
    }
    else{
    AddPlayerClass(strval(CurrentSkin), -2026.6865, 156.8029, 29.0456, 0, 0, 0, 0, 0, 0, 0);
    }
    SetPlayerFacingAngle(playerid,275);
    mysql_free_result();



Re: Help with mysql Skins - TheDeath - 28.07.2012

Wtf i DONT EVEN HAVE CJ AS A SKIN AND SOMETIMES WHEN I ENTER THE GAME IT SHOWS ME TO SPAWN WITH CJ SKIN :@