23.07.2013, 00:38
pawn Код:
if(IsPlayerAdmin(playerid))
{
new string[128], choice[32], garageid, amount;
if(sscanf(params, "s[32]dD", choice, garageid, amount))
{
SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /editgarage [name] [houseid] [(Optional)amount]");
SendClientMessage(playerid, 0xFFFFFFAA, "Available names: Exterior, Interior, Price");
return 1;
}
if(strcmp(choice,"interior",true) == 0)
{
GetPlayerPos(playerid, GarageInfo[garageid][gInteriorX], GarageInfo[garageid][gInteriorY], GarageInfo[garageid][gInteriorZ]);
GetPlayerFacingAngle(playerid, GarageInfo[garageid][gInteriorA]);
GarageInfo[garageid][gHInteriorWorld] = GetPlayerInterior( playerid );
SendClientMessage( playerid, 0x33AA33AA, "Server: You have changed the interior!" );
SaveGarages();
return 1;
}
else if(strcmp(choice,"exterior",true) == 0)
{
GetPlayerPos(playerid, GarageInfo[garageid][gExteriorX], GarageInfo[garageid][gExteriorY], GarageInfo[garageid][gExteriorZ]);
GetPlayerFacingAngle(playerid, GarageInfo[garageid][gExteriorA]);
SendClientMessage( playerid, 0xFFFFFFAA, "Server:You have changed the exterior!" );
DestroyDynamicPickup(GarageInfo[garageid][gPickupID]);
SaveGarages();
if(GarageInfo[garageid][gOwned] == 0)
{
DestroyDynamicPickup(GarageInfo[garageid][gPickupID]);
DestroyDynamic3DTextLabel(GarageInfo[garageid][gTextID]);
format(string, sizeof(string), "This Garage is\n for sale!\nCost: $%d\nID: %d\nTo buy this type /buygarage",GarageInfo[garageid][gValue],garageid);
GarageInfo[garageid][gTextID] = CreateDynamic3DTextLabel( string, 0x33AA33AA, GarageInfo[garageid][gExteriorX], GarageInfo[garageid][gExteriorY], GarageInfo[garageid][gExteriorZ]+0.5,30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 30.0);
GarageInfo[garageid][gPickupID] = CreateDynamicPickup(1318, 23, GarageInfo[garageid][gExteriorX], GarageInfo[garageid][gExteriorY], GarageInfo[garageid][gExteriorZ]);
}
}
else if(strcmp(choice,"price",true) == 0)
{
GarageInfo[garageid][gValue] = amount;
format(string, sizeof(string), "Server: You have set the houses price to $%d.", amount );
SendClientMessage(playerid, 0x33AA33AA, string);
if(GarageInfo[garageid][gOwned] ==0)
{
format(string, sizeof(string), "This Garage is\n for sale!\nCost: $%d\nID: %d\nTo buy this Garage type /buygarage",GarageInfo[garageid][gValue],garageid);
UpdateDynamic3DTextLabelText(GarageInfo[garageid][gTextID],0x33AA33AA , string);
}
}
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "You are not RCON Admin.");
}
return 1;
}