13.05.2014, 17:00
PHP код:
CMD:createshop(playerid, params[])
{
new string[80], file[50], labeltext[50], Float:X, Float:Y, Float:Z;
if(!dini_Exists("StoreInfo.ini"))
{
dini_Create("StoreInfo.ini");
}
GetPlayerPos(playerid, X, Y, Z);
dini_IntSet("StoreInfo.ini", "TotalStores", (dini_Int("StoreInfo.ini", "TotalStores") + 1));
new ammunationid = dini_Int("StoreInfo.ini", "CurrentAmmunationID");
if(ammunationid >= MAX_AMMUNATIONS) return SendClientMessage(playerid, 0xB60000FF, "Unable to create more ammunations. There are already "#MAX_AMMUNATIONS" created. Increase limit in the script to create more.");
else
{
format(string, sizeof(string), "Ammunation ID %d Created.", ammunationid);
format(labeltext, sizeof(labeltext), "Ammunation");
format(file, sizeof(file), "/Files/%d.ini", ammunationid);
if(!dini_Exists(file))
{
dini_Create(file);
}
new msg[128];
format(msg, 128, "Type /scanvenge to Scavenge");
dini_IntSet("StoreInfo.ini", "CurrentAmmunationID", (ammunationid + 1));
dini_IntSet("StoreInfo.ini", "CurrentAmmunationWorld", (ammunationid + 1000));
AmmunationCPOut[ammunationid] = CreateDynamic3DTextLabel(msg, COLOR_LIGHTBLUE, X, Y, Z, 50.0);
}
StoreLabel[dini_Int(file, "StoreID")] = Create3DTextLabel(labeltext, 0x00BC00FF, X, Y, Z, 25, 0, 1);
dini_FloatSet(file, "CPOutX", X);
dini_FloatSet(file, "CPOutY", Y);
dini_FloatSet(file, "CPOutZ", Z);
GetPosInFrontOfPlayer(playerid, X, Y, -2.5);
dini_IntSet(file, "StoreID", dini_Int("StoreInfo.ini", "TotalStores"));
SendClientMessage(playerid, 0xFFFF00AA, string);
return 1;
}
PHP код:
D:\Downloads\ZombieWorld\filterscripts\reality.pwn(147) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warnings.
PHP код:
AmmunationCPOut[ammunationid] = CreateDynamic3DTextLabel(msg, COLOR_LIGHTBLUE, X, Y, Z, 50.0);
PHP код:
#define MAX_AMMUNATIONS 20
new AmmunationCPOut[MAX_AMMUNATIONS];