public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid, pInfo[playerid][posX], pInfo[playerid][posY], pInfo[playerid][posZ]);
SetPlayerFacingAngle(playerid, pInfo[playerid][posR]);
pInfo[playerid][Spawned] = true;
return 1;
}
printf("%f, %f, %f, %f", pInfo[playerid][posX], pInfo[playerid][poxY], pInfo[playerid][posZ], pInfo[playerid][posR]);
AuthPlayer(playerid)
{
CheckMySQL();
new
Float: x,
Float: y,
Float: z,
Float: r;
format(query, 256, "SELECT firstspawn FROM `users` WHERE username = '%s'", PlayerName(playerid));
mysql_query(query);
mysql_store_result();
new rows = mysql_num_rows();
if (rows == 1)
{
format(query, 256, "SELECT x FROM `users` WHERE username = '%s' LIMIT 1", PlayerName(playerid));
mysql_query(query);
mysql_store_result();
mysql_fetch_float(x);
format(query, 256, "SELECT y FROM `users` WHERE username = '%s' LIMIT 1", PlayerName(playerid));
mysql_query(query);
mysql_store_result();
mysql_fetch_float(y);
format(query, 256, "SELECT z FROM `users` WHERE username = '%s' LIMIT 1", PlayerName(playerid));
mysql_query(query);
mysql_store_result();
mysql_fetch_float(z);
format(query, 256, "SELECT r FROM `users` WHERE username = '%s' LIMIT 1", PlayerName(playerid));
mysql_query(query);
mysql_store_result();
mysql_fetch_float(r);
printf("%f, %f, %f, %f", x, y, z, r); // Printing 143.452041, -68.172424, 1.429687, 267.565795 which is correct?
pInfo[playerid][posX] = x;
pInfo[playerid][posY] = y;
pInfo[playerid][posZ] = z;
pInfo[playerid][posR] = r;
}
}
Originally Posted by Rizard
try the same but then OnPlayerRequestSpawn
|
case 'f':
{
new
changestr[16],
changepos = 0,
strpos = stringPos;
while(changepos < 16 && string[strpos] && string[strpos] != delim)
{
changestr[changepos++] = string[strpos++];
}
changestr[changepos] = '\0';
setarg(paramPos,0,_:floatstr(changestr));
}