24.04.2014, 17:30
hey guys I gotta this problem with the cmd gotoh or gotohome
the problem is the error ERROR:You Should Have A House First To Teleport To It, don't appear to players who don't have a house why ?
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 return SendClientMessage(playerid, red, "ERROR:You Should Have A House First To Teleport To It");
return 1;}