House command help
#6

Код:
dcmd_house(playerid, params[])
{
    #pragma unused params
    new file[128];
    new pname[32];
    new giveplayerid, giveplayer[MAX_PLAYER_NAME];
    new Float:HouseX, Float:HouseY, Float:HouseZ;
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_RED,"/house playerid/name");
    if(sscanf(params, "s", pname)) return SendClientMessage(playerid, COLOR_ORANGE, "/house <Name>");
    format(file, sizeof(file), "/xadmin/Users/%s.ini", giveplayer);
    if(!dini_Exists(file))return SendClientMessage(playerid, COLOR_RED,"That Player doesn't have a house");
    HouseX = dini_Float(file, "HouseX");
    HouseY = dini_Float(file, "HouseY");
    HouseZ = dini_Float(file, "HouseZ");
    SetPlayerPos(playerid,HouseX,HouseY,HouseZ);
    return 1;
}
}
I wasn't sure if the sendername string was doing anything, but after editing this code a little, (i know i probably did this wrong), whenever i do /house <anything>, it spawns me at my house everytime. I can even do /house 429420 and it spawns me at my house.
Reply


Messages In This Thread
House command help - by Tommeh - 13.08.2014, 02:07
Re: House command help - by Tommeh - 13.08.2014, 07:48
Re: House command help - by MacT - 13.08.2014, 08:12
Re: House command help - by Tommeh - 13.08.2014, 08:31
Re: House command help - by MacT - 13.08.2014, 08:40
Re: House command help - by Tommeh - 13.08.2014, 08:46
Re: House command help - by Don_Cage - 13.08.2014, 11:45
Re: House command help - by Tommeh - 13.08.2014, 19:09

Forum Jump:


Users browsing this thread: 1 Guest(s)