SA-MP Forums Archive
If Player have selected skin To spawn him directly - 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: If Player have selected skin To spawn him directly (/showthread.php?tid=363501)



If Player have selected skin To spawn him directly - TheDeath - 27.07.2012

Top Line
pawn Код:
new FirstSpawn[MAX_PLAYERS] = false;
OnPlayerReqestClass:
pawn Код:
AddPlayerClass(29,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(10,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(1,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(2,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(3,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(6,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(7,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(13,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(12,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(18,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(17,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(20,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(21,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(22,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(23,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(26,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(32,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(28,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(29,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(45,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(46,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(47,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(48,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(58,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(60,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(65,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(66,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    AddPlayerClass(67,-2026.6143,156.5304,29.0391,275.7126,0,0,0,0,0,0); // SPAWN
    SetPlayerFacingAngle(playerid,275);
    new Query[128],DefaultSkin[4],CurrentSkin[4],CurrentJob[1];
    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);
    mysql_get_field("CurrentJob",CurrentJob);
    if(strval(DefaultSkin) != 0){
    SpawnPlayer(playerid);
    SetPlayerSkin(playerid,strval(CurrentSkin));
    gTeam[playerid] = strval(CurrentJob);
    }
    else{
    FirstSpawn[playerid] = true;
    }
    mysql_free_result();
I Want the player to select skin only the first time he connects
and to save him skin into DefaultSkin


Re: If Player have selected skin To spawn him directly - Ranama - 27.07.2012

You'll have to save the players skin to a saving system like mysql or dini and check if the playername is registered you'll just set his skin to what it is, otherwise you make him chose skin

This forum requires that you wait 120 seconds between posts. Please try again in 29 seconds. ;(