Making a goto cmd
#3

Without loops and assuming you have your businesses saved by ID.
pawn Код:
CMD:telebiz(playerid, params[])
{
    new id;
    if(sscanf(params, "i", id)) return SendClientMessage(playerid, 0xFF0000FF, "SYNTAX: /Telebiz [id]");
    new string[100];
    format(string,sizeof(string),"/MyServerFiles/MyConfigFiles/MyBusinesses/%d.ini", id); //This should be the path of your businesses, is not necessary but it highly recommended in this situation.
    if(fexist(string)) //If the business ID exists
    {
        SetPlayerPos(playerid, BizInfo[id][PropX], BizInfo[id][PropY], BizInfo[id][PropZ]); //Obviously replace BizInfo with your own enum values etc.
        format(string,sizeof(string),"You have teleported to business ID: %d", id);
        SendClientMessage(playerid, 0xFFFF00FF, string);
    }
    else return SendClientMessage(playerid, 0xFF0000FF, "This business doesn't exist, please try again.");
    return 1;
}
Reply


Messages In This Thread
Making a goto cmd - by Fernado Samuel - 12.12.2012, 12:39
Re : Making a goto cmd - by [HRD]Mar1 - 12.12.2012, 12:53
Re: Making a goto cmd - by Threshold - 12.12.2012, 12:54
Re: Making a goto cmd - by Fernado Samuel - 12.12.2012, 13:12

Forum Jump:


Users browsing this thread: 1 Guest(s)