SA-MP Forums Archive
MySQL Spawning - 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: MySQL Spawning (/showthread.php?tid=409797)



MySQL Spawning - AphexCCFC - 23.01.2013

How would I go about spawning a player that has SpawnX, SpawnY, SpawnZ coords, SkinID and AngleA in the database? Would this be correct?

pawn Код:
format(query, sizeof(query), "SELECT SpawnX,SpawnY,SpawnZ,SkinID,AngleA FROM playerdata WHERE user = '%s'", pname);
    mysql_query(query);
    mysql_store_result();
    SetSpawnInfo(playerid, 0, SkinID, SpawnX, SpawnY, SpawnZ, AngleA, 0, 0, 0, 0, 0, 0);
    SpawnPlayer(playerid);
    mysql_free_result();