Help with mysql Skins
#1

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();
Reply
#2

Why are you using AddPlayerClass?

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

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

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();
Reply
#5

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


Forum Jump:


Users browsing this thread: 3 Guest(s)