(DCMD) Make one command do several things problem
#5

pawn Код:
dcmd_house(playerid, params[])
{
    if(Account[playerid][pAdminLvl] <= 20)
        return AdministratorError(playerid,20);
       
    new string[128];
   
    if (params[0]=='\0')
        return SendClientMessage(playerid, COLOR_WHITE, "SERVER: /house [add | delete]");
   
    else if(!strcmp(params, "add", true, 3))
    {
        new Float:X,Float:Y,Float:Z,Interior,World,Float:Angle,houseid;
        GetPlayerPos(playerid,X,Y,Z);
        World=GetPlayerVirtualWorld(playerid);
        Interior=GetPlayerInterior(playerid);
        GetPlayerFacingAngle(playerid,Angle);
        houseid=AddHouse("None",X,Y,Z,World,Interior,Angle,0.0,0.0,0.0,0,0.0,0,0,0,99999999,1);
        format(string,sizeof(string),"INFO: House id %d successfully created, there are now %d houses in the server.",houseid,HOUSE_COUNT);
        return SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
    }
   
    else if(!strcmp(params, "delete", true, 6 ))
    {
        new houseid;
        if (params[6]=='\0' || sscanf(params[7], "d", houseid))
            return SendClientMessage(playerid, COLOR_WHITE, "SERVER: /house [delete] [houseid]");
           
        format(string,sizeof(string),"INFO: House ID %d.",houseid);
        SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
        if(dini_Exists(GetHouse(houseid)))
        {
            DeleteHouse(houseid);
            format(string,sizeof(string),"INFO: House id %d successfully deleted, there are now %d houses in the server.",houseid,HOUSE_COUNT);
            return SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
        }
        else
        {
            format(string,sizeof(string),"INFO: House id %d does not exist!.",houseid);
            return SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
        }
    }
    return 0;
}
Reply


Messages In This Thread
(DCMD) Make one command do several things problem - by Norn - 24.03.2009, 02:27
Re: (DCMD) Make one command do several things problem - by Backwardsman97 - 24.03.2009, 03:00
Re: (DCMD) Make one command do several things problem - by Norn - 24.03.2009, 03:04
Re: (DCMD) Make one command do several things problem - by TheSh@rk - 24.03.2009, 10:30
Re: (DCMD) Make one command do several things problem - by pen_theGun - 24.03.2009, 11:13
Re: (DCMD) Make one command do several things problem - by Norn - 24.03.2009, 23:37
Re: Delete me - by Backwardsman97 - 24.03.2009, 23:47
Re: Delete me - by Norn - 24.03.2009, 23:50

Forum Jump:


Users browsing this thread: 2 Guest(s)