cmd:gotoh error help
#1

hey guys I gotta this problem with the cmd gotoh or gotohome
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;}
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 ?
Reply
#2

bump
Reply
#3

pawn Код:
else
{
return SendClientMessage(playerid, red, "ERROR:You Should Have A House First To Teleport To It");
}
return 1;
}
Reply
#4

thanks it worked perfectly +rep
Reply
#5

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)