10.06.2015, 15:12
PHP код:
if(strcmp(cmd, "/createhouse", true) == 0)
{
//You don't need to check if player is connected ...
if(PlayerInfo[playerid][pAdmin] < 3)return SendClientMessage(playerid, COLOR_GRAD1, "You don't have acces to use this command.");
new type,price,level,interior;
if(sscanf(cmd, "dddd", type,price,level,interior)){
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /createhouse [type] [price] [level] [interior]");
SendClientMessage(playerid, COLOR_GRAD2, "TYPE: (1) Small , Medium , Big");
return 1;
}
GetPlayerPos(playerid, HouseInfo[hid][hEntrancex], HouseInfo[hid][hEntrancey], HouseInfo[hid][hEntrancez]);
new hid = sHouse + 1;
HouseInfo[hid][hOwned] = 0;
HouseInfo[hid][hRent] = 0;
HouseInfo[hid][hLevel] = level;
HouseInfo[hid][hTakings] = 0;
format(HouseInfo[hid][hOwner], 24, "No-One");//MAX name length 24
if(type == 1){
if(interior == 1){
HouseInfo[hid][hType] = 1;
HouseInfo[hid][hInt] = 10;
HouseInfo[hid][hExitx] = 2259.38;
HouseInfo[hid][hExity] = -1135.77;
HouseInfo[hid][hExitz] = 1050.64;
}
}
new fftext[20];
if(HouseInfo[hid][hType] == 1) { fftext = "mic"; }
HouseInfo[hid][hPickup] = AddStaticPickup(1273, 23, HouseInfo[hid][hEntrancex],HouseInfo[hid][hEntrancey], HouseInfo[hid][hEntrancez]);
format(string, sizeof(string), "[ Casa de vanzare ]\n\n( Pret de cumparare %d$ )\n( Nivelul necesar %d )\n( Interiorul este %s )", HouseInfo[hid][hValue], HouseInfo[hid][hLevel], fftext);
HouseInfo[hid][hText3D] = CreateDynamic3DTextLabel(string, COLOR_GROVE, HouseInfo[hid][hEntrancex],HouseInfo[hid][hEntrancey], HouseInfo[hid][hEntrancez],10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1,0,-1,-1, 45.0);
sHouse++;
printf(" Am creat casa %d", sHouse);
return 1;
}
