CMD:chouse(playerid, params[])
{
new tmp[256];
new cmd[256+1];
new idx;
cmd = strtok(cmdtext, idx);
tmp = strtok(cmdtext,idx);
new tmp2[256];
tmp2 = strtok(cmdtext,idx);
if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid,-1,"Use: /chouse [price] [intid]");
new id = strval(tmp2);
new Price = strval(tmp);
if(Price <= 0)
return SendClientMessage(playerid,-1,"Invalid house price. The house price must be between $"#MIN_HOUSE_PRICE" and $"#MAX_HOUSE_PRICE"");
CreateHouse(playerid,GetFreeHouseID(),Price,id);
SendClientMessage(playerid,-1,"House Created");
return 1;
}
CMD:chouse(playerid, params[])
{
new price, int;
if(sscanf(params, "dd",price, int)) return SendClientMessage(playerid,-1,"Use: /chouse [price] [intid]");
if(Price <= 0) return SendClientMessage(playerid,-1,"Invalid house price. The house price must be between $"#MIN_HOUSE_PRICE" and $"#MAX_HOUSE_PRICE"");
CreateHouse(playerid,GetFreeHouseID(),Price,id);
SendClientMessage(playerid,-1,"House Created");
return 1;
}
CMD:addcar(playerid,params[])
{
new tmp[256];
new cmd[256+1];
new idx;
cmd = strtok(cmdtext, idx);
tmp = strtok(cmdtext,idx);
new hid = strval(tmp);
if(IsPlayerInAnyVehicle(playerid))
{
new Float:X,Float:Y,Float:Z,Float:Angle;
GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
new model = GetVehicleModel(GetPlayerVehicleID(playerid));
dini_IntSet(HouseFile(hid),"vModel",model);
dini_FloatSet(HouseFile(hid),"vX",X);
dini_FloatSet(HouseFile(hid),"vY",Y);
dini_FloatSet(HouseFile(hid),"vZ",Z);
dini_FloatSet(HouseFile(hid),"vAng",Angle);
}
else return SendClientMessage(playerid,-1,"You need to be in a vehicle to add a house car");
return 1;
}
CMD:removehouse(playerid, params[])
{
new tmp[256];
new cmd[256+1];
new idx;
cmd = strtok(cmdtext, idx);
tmp = strtok(cmdtext,idx);
new hid = strval(tmp);
if(dini_Exists(HouseFile(hid)))
{
foreach(Player, i)
{
if(IsPlayerInHouse[i][hid] == 1)
{
ExitPlayerFromHouse(i,hid);
}
}
Delete3DTextLabel(HouseInfo[hid][Text]);
DestroyDynamicCP(hCpOut[hid]);
IsValidDynamicCP(hCpIn[hid]);
dini_Remove(HouseFile(hid));
}
return 1;
}
CMD:removehouse(playerid, params[])
{
new hid;
if(sscanf(params, "u", hid)) return SendClientMessage(playerid, -1, "/removehouse [id]");
if(dini_Exists(HouseFile(hid)))
{
foreach(Player, i)
{
if(IsPlayerInHouse[i][hid] == 1)
{
ExitPlayerFromHouse(i,hid);
}
}
Delete3DTextLabel(HouseInfo[hid][Text]);
DestroyDynamicCP(hCpOut[hid]);
IsValidDynamicCP(hCpIn[hid]);
dini_Remove(HouseFile(hid));
}
return 1;
}
also this
PHP код:
PHP код:
|