03.07.2013, 19:14
I made a garage system
But when you /buygarage it spams the chat "You are not at a garage"
Codes of /buygarage:
Code Which spam in chat:
Help = +rep
But when you /buygarage it spams the chat "You are not at a garage"
Codes of /buygarage:
pawn Код:
CMD:buygarage(playerid, params[])
{
new string[128];
new playername[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new h = 0; h < sizeof(GarageInfo); h++)
{
if(GarageInfo[h][gOwned] == 0 )
{
if(IsPlayerInRangeOfPoint(playerid,2.0,GarageInfo[h][gExteriorX], GarageInfo[h][gExteriorY], GarageInfo[h][gExteriorZ]) )
{
if(GetPlayerMoney(playerid) > GarageInfo[h][gValue])
{
PlayerInfo[playerid][pPgaragekey] = h;
GarageInfo[h][gOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(GarageInfo[h][gOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoney(playerid,-GarageInfo[h][gValue]);
SetPlayerInterior(playerid,GarageInfo[h][gHInteriorWorld]);
if(GarageInfo[h][gCustomInterior] == 1)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Loading....", 4000, 5);
SetPVarInt(playerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", playerid);
}
SetPlayerPos(playerid,GarageInfo[h][gInteriorX],GarageInfo[h][gInteriorY],GarageInfo[h][gInteriorZ]);
GameTextForPlayer(playerid, "~w~Welcome Home~n~You can exit at any time by /exitgarage", 5000, 3);
SaveGarages();
SetPlayerVirtualWorld(playerid, h+6000);
DestroyDynamicPickup(GarageInfo[h][gPickupID]);
GarageInfo[h][gPickupID] = CreateDynamicPickup(1318, 23, GarageInfo[h][gExteriorX], GarageInfo[h][gExteriorY], GarageInfo[h][gExteriorZ]);
format(string, sizeof(string), "Garage Owned by\n %s\nID: %d",GarageInfo[h][gOwner],h);
UpdateDynamic3DTextLabelText(GarageInfo[h][gTextID], 0x33CCFFAA, string);
return 1;
}
else
{
SendClientMessage(playerid, 0x33CCFFAA, " You don't have the cash for that!");
return 1;
}
}
else
{
SendClientMessage(playerid, 0x33CCFFA, " You are not at a garage.");
}
}
else
{
SendClientMessage(playerid, 0x33CCFFA, "this garage is owned!");
}
}
return 1;
}
pawn Код:
SendClientMessage(playerid, 0x33CCFFA, " You are not at a garage.");
Help = +rep
