31.08.2015, 14:34
Well, what i can get from your explanation i can give this example out;
Set a playervar under the response of register dialog when player just gets registered.
And when player spawns, check if the variable is 1 or not, if it is 1 then execute the query to insert the player's skin id into the table cause when they spawn, skin is already set so you can fetch the skin id using GetPlayerSkin(playerid); function;
I know there are more better ways than this but this is what i can think of so far.
Set a playervar under the response of register dialog when player just gets registered.
PHP код:
SetPVarInt(playerid, "JustRegistered", 1);
PHP код:
public OnPlayerSpawn(playerid)
{
if (GetPVarInt(playerid, "JustRegistered") == 1)
{
new
query[128];
mysql_format(mysql, query, sizeof(query), "UPDATE `...` SET `SkinID`='%d' WHERE `uniqueid`='%d'", GetPlayerSkin(playerid), uniqueidhere); // Change the unique id with yours
mysql_tquery(mysql, query, "", "");
DeletePVar(playerid, "JustRegistered"); // Deleting this so query won't be executed next time the player spawns
}
return 1;
}

