25.08.2016, 18:01
hello, I created this code. Everything works, ALL SendClientMessageToAll messages work, and show in the server... Except one, not sure why at all... Cannot find the problem ahaha: I'll comment the line that doesn't show
Also, how come when I'm in game and after I've set the business interior/exterior... I type /createbusiness Complete and it returns "Error: File already exists". Here is the code:
pawn Код:
command(amode, playerid, params[])
{
#pragma unused params
if(Player[playerid][AdminLevel] >=8)
{
if(ApocalypseStatus == 0)
{
ApocalypseStatus = 1;
SetWeather(19);
SendClientMessageToAll(LIGHTRED, "___________________________**** EMERGENCY BROADCAST SYSTEM****___________________________");
SendClientMessageToAll(ADMINORANGE, "Attention citizens of San Andreas. A deadly virus has been detected in the Zombotech Corporation Lab in Downtown, San Fierro.");
SendClientMessageToAll(ADMINORANGE,"Authorities strongly urge citizens of San Andreas to find a safe place to hide as there is a high possibility the virus will reach Los Santos soon.");
SendClientMessageToAll(ADMINORANGE,"If you unable to reach a safe place, group up with other survivors, arm yourselves and stay away from populated areas.");
SendClientMessageToAll(ADMINORANGE,"Any heavily infected humans attempting to approach authority will be executed. At this point our government has not found a cure for");
//Only this line doesn't show in server SendClientMessageToAll(ADMINORANGE,"this virus and quarantined humans are highly contagious. The Apocalypse Government (AG) in Bayside Marina are currently searching for a solution to this epidemic.");
SendClientMessageToAll(ADMINORANGE,"So remember.. Group up, find a safe place and stay away from populated areas! Loud noises will attract unwanted attention from the infected.");
}
else
{
ApocalypseStatus = 0;
SetWeather(1);
SendClientMessageToAll(LIGHTRED, "___________________________**** EMERGENCY BROADCAST SYSTEM****___________________________");
SendClientMessageToAll(ANNOUNCEMENT, "Attention citizens of San Andreas. Authorities of Los Santos have searched the borders of the city and declared the state safe for now.");
SendClientMessageToAll(ANNOUNCEMENT, "All infected humans have been deemed dead and taken into scientific labs for testing in an undisclosed location in Tierra Robada.");
SendClientMessageToAll(ANNOUNCEMENT, "If you have any symtops of the virus, contact Zombie Emergency Response Operations (Z.E.R.O) urgently and you will be placed in qurantine and treated.");
}
}
return 1;
}
Also, how come when I'm in game and after I've set the business interior/exterior... I type /createbusiness Complete and it returns "Error: File already exists". Here is the code:
pawn Код:
command(createbusiness, playerid, params[])
{
new Usage[128], string[128];
if(sscanf(params, "z", Usage))
{
if(Player[playerid][AdminLevel] >= 5)
{
SendClientMessage(playerid, WHITE, "SYNTAX: /createbusiness [usage]");
SendClientMessage(playerid, GREY, "Usage: Interior, Exterior or Complete.");
}
}
else
{
if(Player[playerid][AdminLevel] >= 5)
{
if(strcmp(Usage, "exterior", true) == 0)
{
Player[playerid][BusinessExterior]++;
Player[playerid][bExtID] = GetPlayerInterior(playerid);
GetPlayerPos(playerid, Player[playerid][bExtX], Player[playerid][bExtY], Player[playerid][bExtZ]);
format(string, sizeof(string), "Exterior set! (X: %f, Y: %f, Z: %f).", Player[playerid][bExtX], Player[playerid][bExtY], Player[playerid][bExtZ]);
SendClientMessage(playerid, WHITE, string);
}
if(strcmp(Usage, "interior", true) == 0)
{
Player[playerid][BusinessInterior]++;
Player[playerid][bIntID] = GetPlayerInterior(playerid);
GetPlayerPos(playerid, Player[playerid][bIntX], Player[playerid][bIntY], Player[playerid][bIntZ]);
format(string, sizeof(string), "Interior set! (X: %f, Y: %f, Z: %f).", Player[playerid][bIntX], Player[playerid][bIntY], Player[playerid][bIntZ]);
SendClientMessage(playerid, WHITE, string);
}
if(strcmp(Usage, "complete", true) == 0)
{
if(Player[playerid][BusinessInterior] > 0 || Player[playerid][BusinessExterior] > 0)
{
new NewBusinessID = SpawnedBusinesses+1;
if(NewBusinessID >= MAX_BUSINESSES)
{
SendClientMessage(playerid, WHITE, "Too many businesses are currently spawned!");
}
format(string, sizeof(string), "Businesses/Business_%d.ini", NewBusinessID);
if(!fexist(string))
{
Businesses[NewBusinessID][bInteriorID] = Player[playerid][bIntID];
Businesses[NewBusinessID][bExteriorID] = Player[playerid][bExtID];
Businesses[NewBusinessID][bInteriorX] = Player[playerid][bIntX];
Businesses[NewBusinessID][bInteriorY] = Player[playerid][bIntY];
Businesses[NewBusinessID][bInteriorZ] = Player[playerid][bIntZ];
Businesses[NewBusinessID][bExteriorX] = Player[playerid][bExtX];
Businesses[NewBusinessID][bExteriorY] = Player[playerid][bExtY];
Businesses[NewBusinessID][bExteriorZ] = Player[playerid][bExtZ];
format(Businesses[NewBusinessID][bOwner], 255, "Nobody");
Businesses[NewBusinessID][bLockStatus] = 1;
Businesses[NewBusinessID][bPrice] = 0;
Businesses[NewBusinessID][bType] = 0;
format(Businesses[NewBusinessID][bName], 255, "Nothing");
Businesses[NewBusinessID][bPickupID] = CreateDynamicPickup(1239, 23, Businesses[NewBusinessID][bExteriorX], Businesses[NewBusinessID][bExteriorY], Businesses[NewBusinessID][bExteriorZ], 0, -1, -1, 150.0);
dini_Create(string);
dini_FloatSet(string, "ExteriorX", Businesses[NewBusinessID][bExteriorX]);
dini_FloatSet(string, "ExteriorY", Businesses[NewBusinessID][bExteriorY]);
dini_FloatSet(string, "ExteriorZ", Businesses[NewBusinessID][bExteriorZ]);
dini_IntSet(string, "ExteriorID", Businesses[NewBusinessID][bExteriorID]);
dini_FloatSet(string, "InteriorX", Businesses[NewBusinessID][bInteriorX]);
dini_FloatSet(string, "InteriorY", Businesses[NewBusinessID][bInteriorY]);
dini_FloatSet(string, "InteriorZ", Businesses[NewBusinessID][bInteriorZ]);
dini_IntSet(string, "InteriorID", Businesses[NewBusinessID][bInteriorID]);
dini_IntSet(string, "Type", Businesses[NewBusinessID][bType]);
dini_IntSet(string, "Vault", Businesses[NewBusinessID][bVault]);
dini_IntSet(string, "Price", Businesses[NewBusinessID][bPrice]);
dini_Set(string, "Owner", Businesses[NewBusinessID][bOwner]);
dini_IntSet(string, "LockStatus", Businesses[NewBusinessID][bLockStatus]);
dini_Set(string, "Name", Businesses[NewBusinessID][bName]);
Player[playerid][BusinessExterior]--;
Player[playerid][BusinessInterior]--;
SpawnedBusinesses++;
SendClientMessage(playerid, NICESKY, "Successfully created business!");
format(string, sizeof(string), "Please now proceed to use /businesstype and /businessprice (ID: %d)", NewBusinessID);
SendClientMessage(playerid, WHITE, string);
SetPlayerInterior(playerid, Businesses[NewBusinessID][bExteriorID]);
SetPlayerPos(playerid, Businesses[NewBusinessID][bExteriorX], Businesses[NewBusinessID][bExteriorY], Businesses[NewBusinessID][bExteriorZ]);
}
else
{
SendClientMessage(playerid, WHITE, "Error: File already exists!");
}
}
else
{
SendClientMessage(playerid, WHITE, "You must select an exterior and an interior first!");
}
}
}
}
return 1;
}