24.04.2014, 17:58
try this
pawn Код:
CMD:gotoh(playerid,params[])
{
if(PlayerInfo[playerid][Jailed] == 1)
{
return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!");
}
new str1[256],pname[24],str[256];
GetPlayerName(playerid, pname, sizeof(pname));
format(str1, sizeof(str1), "ladmin/users/%s.sav", udb_encode(pname));
if (dini_Exists(str1))
{
if(dini_Int(str1,"Houseid")!=-255)
{
TeleTimer = SetTimerEx("ttimer", 1000, true, "i",playerid);
tseconds[playerid] = 6;
format(tstring,45,"You Must wait %d seconds before teleporting", tseconds[playerid]-1);
if(PlayerInfo[playerid][Level] == 0) SendClientMessage(playerid,COLOR_LIGHTBLUE, tstring);
vCount[playerid] = 1;
Tx[playerid] = dini_Float(str1,"SpawnX");
Ty[playerid] = dini_Float(str1,"SpawnY");
Tz[playerid] = dini_Float(str1,"SpawnZ");
Ti[playerid] = strval(str);
format(telestring,43,"Welcome Home Baby!");
}
else
{
SendClientMessage(playerid, red, "ERROR:You Should Have A House First To Teleport To It");
}
}
return 1;
}