Код:
forward public TeleportPlayer(playerid);
public TeleportPlayer(playerid)
{
new admdebug[255];
if(cache_num_rows() > 0)
{
for(new i;i<cache_num_rows();i++)
{
new pos_x[50],pos_y[50],pos_z[50],int[50],vw[50],city_tele[200];
cache_get_field_content(i, "x", pos_x);
cache_get_field_content(i, "y", pos_y);
cache_get_field_content(i, "z", pos_z);
cache_get_field_content(i, "int", int);
cache_get_field_content(i, "vw", vw);
cache_get_field_content(i, "Name", city_tele);
SetPlayerVirtualWorld(playerid, vw); // Here is the error
SetPlayerInterior(playerid, int); // Here is the error
SetPlayerPos(playerid, pos_x, pos_y, pos_z); // Here is the error
format(admdebug, sizeof(admdebug), "[INFO]:{E0E0E0} You have teleported to %s!", city_tele);
SendClientMessage(playerid, COLOR_BLUE, admdebug);
format(admdebug, sizeof(admdebug), "[AMSG] (%d) %s has teleported to %s!", playerid, GetUserName(playerid), city_tele);
SendAdminMsgEx(admdebug);
}
} else return SendClientMessage(playerid, COLOR_ERROR, "[ERROR 205]{E0E0E0} Please print screen this and make a post in the bug reports thanks."); // Seems like some of the city tables are empty
return 1;
}
pawn Код:
new Float:pos_x, Float:pos_y, Float:pos_z, inter, vw, city_tele[200];
pos_x = cache_get_field_content_float(i, "x");
pos_y = cache_get_field_content_float(i, "y");
pos_z = cache_get_field_content_float(i, "z");
inter = cache_get_field_content_int(i, "int");
vw = cache_get_field_content_int(i, "vw");
SetPlayerVirtualWorld(playerid, vw); // Here is the error
SetPlayerInterior(playerid, inter); // Here is the error
SetPlayerPos(playerid, pos_x, pos_y, pos_z); // Here is the error