Help CMD
#1

When I compile it pawn crash, why?

[SPOILER]
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#define	MAX_GARAGES 51 // Ignore 1

// Garages Settings
enum garageInfo
{
	gLevel,
	gPrice,
	gOwner[32],
	Float:gX,
	Float:gY,
	Float:gZ,
	gPickup,
	Text3D:gText
}
new GarageInfo[MAX_GARAGES][garageInfo];

stock LoadGarages()
{
	new binfo[21][32];
	new string[256];
	new File:file = fopen("garages.cfg", io_read);
	if(file)
	{
	    new idx = 1;
		while(idx < MAX_GARAGES)
		{
		    fread(file, string);
		    split(string, binfo, '|');
		    format(GarageInfo[idx][gOwner], 32, "%s", binfo[3]);
		    GarageInfo[idx][gX] = floatstr(binfo[4]);
		    GarageInfo[idx][gY] = floatstr(binfo[5]);
		    GarageInfo[idx][gZ] = floatstr(binfo[6]);
			if(GarageInfo[idx][gLevel])
			{
			    GarageInfo[idx][gPickup] = CreateDynamicPickup(1277, 1, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ], 0);
                if(!strcmp("The State", GarageInfo[idx][gOwner])) format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)\n"COE"\n"COE"Owner"CWE" %s\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
				else format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner]);
				GarageInfo[idx][gText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]+0.3, 15);

			}
			idx++;
	    }
	}
	print("Garages loaded successfully.");
	return 1;
}

stock SaveGarages()
{
	new idx = 1, File:file;
	new string[256];
	while(idx < MAX_GARAGES)
	{
	    format(string, sizeof(string), "%d|%d|%s|%f|%f|%f\r\n",
	    GarageInfo[idx][gLevel],
	    GarageInfo[idx][gPrice],
	    GarageInfo[idx][gOwner],
	    GarageInfo[idx][gX],
	    GarageInfo[idx][gY],
	    GarageInfo[idx][gZ]
		);
	    if(idx == 1)
	    {
	        file = fopen("garages.cfg", io_write);
	    }
	    else
	    {
	    	file = fopen("garages.cfg", io_append);
	    }
		fwrite(file, string);
		fclose(file);
		idx++;
	}
	print("Garages saved successfully.");
}

stock CheckFiles()
{
if(!dini_Exists("garages.cfg")) dini_Create("garages.cfg");
	return 1;
}


public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}


if(strcmp("/garageusato", cmdtext, true) == 0)
{
	new string[128];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
	SendClientMessage(playerid, COLOR_ORANGE, "[Used Garages]:");
	for(new idx=1; idx<MAX_GARAGES; idx++)
	{
	    if(GarageInfo[idx][gLevel])
	    {
			format(string, sizeof(string), "ID: %d | Owner: %s | Price: %d", idx, GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
			SendClientMessage(playerid, COLOR_ORANGE, string);
	    }
	}
	return 1;
}

if(strcmp("/compragarage", cmdtext, true) == 0)
{
	new string[128], done;
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pGarage]) return SendClientMessage(playerid, COLOR_GREY, "You already own a garage.");
	for(new idx=1; idx<MAX_GARAGES; idx++)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 3, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
	    {
			if(!strcmp("The State", GarageInfo[idx][gOwner], false))
			{
			    if(PlayerInfo[playerid][pMoney] < GarageInfo[idx][gPrice]) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to buy this garage.");
				GiveZaiatMoney(playerid, -GarageInfo[idx][gPrice]);
				if(PlayerInfo[playerid][pGarage]) PlayerInfo[playerid][pGarage] = idx;
				else PlayerInfo[playerid][pGarage] = idx;
			    format(GarageInfo[idx][gOwner], 32, "%s", RPNU(playerid));
			    format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner]);
				UpdateDynamic3DTextLabelText(GarageInfo[idx][gText], COLOR_WHITE, string);
				SendClientMessage(playerid, COLOR_GREEN, " You have successfully bought a garage.");
				format(string, sizeof(string), "%s has bought garage id %d.", RPN(playerid), idx);
				Log("logs/garage.log", string);
				idx = MAX_GARAGES;
				done = 1;
			}
			if(idx == MAX_GARAGES-1 && !done)
			{
			    SendClientMessage(playerid, COLOR_GREY, "This garage is owned by someone else.");
			}
	    }
	    if(idx == MAX_GARAGES-1 && !done)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You are not near a buyable garage.");
	    }
	}
	return 1;
}

if(strcmp("/vendigarage", cmdtext, true) == 0)
{
	new string[128], done;
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!PlayerInfo[playerid][pGarage] && !PlayerInfo[playerid][pVHouse]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a house.");
	if(sscanf(params, "s[8]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellgaragetogov confirm");
	if(!strcmp(params, "confirm", true))
	{
	    new idx = PlayerInfo[playerid][pGarage];
	    if(IsPlayerInRangeOfPoint(playerid, 2, GarageInfo[PlayerInfo[playerid][pGarage]][gX], GarageInfo[PlayerInfo[playerid][pGarage]][gY], GarageInfo[PlayerInfo[playerid][pGarage]][gZ]))
	    {
	        GiveZaiatMoney(playerid, (75*GarageInfo[PlayerInfo[playerid][pGarage]][gPrice])/100);
		    format(GarageInfo[PlayerInfo[playerid][pGarage]][gOwner], 32, "The State");
		    format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: For Sale\nPrice: $%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
		    UpdateDynamic3DTextLabelText(GarageInfo[PlayerInfo[playerid][pGarage]][gText], COLOR_WHITE, string);
		    PlayerInfo[playerid][pGarage] = 0;
		    SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your house to The State. (75 percent of the original price was paid back)");
            format(string, sizeof(string), "%s has sold house id %d to the market.", RPN(playerid), idx);
			Log("logs/garage.log", string);
			done = 1;
	    }
		if(!done)
		{
  			idx = PlayerInfo[playerid][pVHouse];
		    if(IsPlayerInRangeOfPoint(playerid, 3, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
		    {
		        GiveZaiatMoney(playerid, (75*GarageInfo[idx][gPrice])/100);
			    format(GarageInfo[idx][gOwner], 32, "The State");
			    format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
			    UpdateDynamic3DTextLabelText(GarageInfo[idx][gText], COLOR_WHITE, string);
			    SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your garage to The State. (75 percent of the original price was paid back)");
	            format(string, sizeof(string), "%s has sold garage id %d to the market.", RPN(playerid), idx);
				Log("logs/garage.log", string);
				done = 1;
		    }
		}
	    if(!done)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You are not near your garage.");
	        return 1;
	    }
    }
	return 1;
}

if(strcmp("/creagarage", cmdtext, true) == 0)
{
	new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
	for(new idx=1; idx<MAX_GARAGES; idx++)
	{
	    if(!GarageInfo[idx][gLevel])
		{
		    // Getting Garage Setup
		    new Float:X, Float:Y, Float:Z;
		    GetPlayerPos(playerid, X, Y, Z);
		    // Making Garage
		    GarageInfo[idx][gLevel] = 1;
		    GarageInfo[idx][gPrice] = 99999999;
		    format(GarageInfo[idx][gOwner], 32, "The State");
		    GarageInfo[idx][gX] = X;
		    GarageInfo[idx][gY] = Y;
		    GarageInfo[idx][gZ] = Z;
		    GarageInfo[idx][gPickup] = CreateDynamicPickup(1277, 1, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ], 0);
            format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
			GarageInfo[idx][gText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]+0.3, 15);
			format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created garage ID %d.", RPN(playerid), idx);
			SendAdminMessage(COLOR_DARKRED, 1, string);
			Log("logs/garage.log", string);
			idx = MAX_GARAGES;
		}
	}
	return 1;
}

if(strcmp("/rimuovigarage", cmdtext, true) == 0)
{
	new id, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
	if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletegarage [garageid]");
	if(!GarageInfo[id][gLevel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid garage id.");
    foreach(Player, i)
	{
	    if(IsPlayerLoggedIn(i) && PlayerInfo[i][pGarage] == id)
		{
		    PlayerInfo[i][pGarage] = 0;
		    format(string, sizeof(string), " Administrator %s has deleted your garage.", RPN(playerid));
			SendClientMessage(i, COLOR_WHITE, string);
		}
	}
	if(!strcmp("The State", GarageInfo[id][gOwner]))
	{
		format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has deleted garage ID %d.", RPN(playerid), id);
	}
	else
	{
	    format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has deleted %s's garage. (ID %d)", RPN(playerid), GarageInfo[id][gOwner], id);
	}
	SendAdminMessage(COLOR_DARKRED, 1, string);
	Log("logs/garage.log", string);
	GarageInfo[id][gLevel] = 0;
    GarageInfo[id][gPrice] = 0;
    format(GarageInfo[id][gOwner], 32, "");
    GarageInfo[id][gX] = 0;
    GarageInfo[id][gY] = 0;
    GarageInfo[id][gZ] = 0;
    DestroyDynamicPickup(GarageInfo[id][gPickup]);
    DestroyDynamic3DTextLabel(GarageInfo[id][gText]);
	return 1;
}

if(strcmp("/entra", cmdtext, true) == 0)
{
for(new idx=1; idx<MAX_GARAGES; idx++) // Dynamic Garages
	{
		if(IsPlayerInRangeOfPoint(playerid, 5, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ])/* && GetPlayerState(playerid) == PLAYER_STATE_DRIVER*/)
	    {
	        format(string, sizeof(string), "* %s enters the garage.", RPN(playerid));
			if(PlayerInfo[playerid][pMaskOn] == 1)
			{
			   format(string, sizeof(string), "* Stranger enters the garage.");
			}
			else
			{
				format(string, sizeof(string), "* %s enters the garage.", RPN(playerid));
			}
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	        SetPlayerVirtualWorld(playerid, idx+500);
	        //SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), idx+500);
	        new vehicleid = GetPlayerVehicleID(playerid);
			if(GarageInfo[idx][gLevel] == 1)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
			if(GarageInfo[idx][gLevel] == 2)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
			if(GarageInfo[idx][gLevel] == 3)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
			if(GarageInfo[idx][gLevel] == 4)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
			if(GarageInfo[idx][gLevel] == 5)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
			if(GarageInfo[idx][gLevel] == 6)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
			if(GarageInfo[idx][gLevel] == 7)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
			if(GarageInfo[idx][gLevel] == 8)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
			if(GarageInfo[idx][gLevel] == 9)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
			if(GarageInfo[idx][gLevel] == 10)
			{
				if(IsPlayerInAnyVehicle(playerid))
				{
				    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
			        SetCameraBehindPlayer(playerid);
			        SetVehicleVirtualWorld(vehicleid, idx+500);
				}
				else
				{
				    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
				    SetPlayerInterior(playerid, 0);
				    SetCameraBehindPlayer(playerid);
				}
			}
	        return 1;
		}
	}
	return 1;
}

if(strcmp("/saveproject", cmdtext, true) == 0)
{
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
    foreach(Player, i)
 	SaveGarages();
    format(string, sizeof(string), "{FF0000}[Manual Save]{FF6347} Your Project has manualy saved!");
	SendClientMessageToAll(COLOR_LIGHTRED, string);
	return 1;
}

if(strcmp("/idgarage", cmdtext, true) == 0)
{
	new bizid, string[128], input;
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
	if(sscanf(params, "s[32]", params))
	{
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit [option] [garageid]");
		SendClientMessage(playerid, COLOR_GREY, "OPTIONS: location | price | level");
		return 1;
	}
	if(!strcmp(params, "location", true, 8))
	{
	    if(sscanf(params, "s[32]i", params, bizid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ggedit location [house]");
        new idx = bizid;
        if(!GarageInfo[bizid][gLevel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid garage id.");
		GetPlayerPos(playerid, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]);
		DestroyDynamicPickup(GarageInfo[idx][gPickup]);
    	GarageInfo[idx][gPickup] = CreateDynamicPickup(1277, 1, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ], 0);
		DestroyDynamic3DTextLabel(GarageInfo[idx][gText]);
        if(!strcmp("The State", GarageInfo[idx][gOwner])) format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
		else format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner]);
		GarageInfo[idx][gText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]+0.3, 15);
	    format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has changed garage ID %d's location.", RPN(playerid), bizid);
		SendAdminMessage(COLOR_DARKRED, 1, string);
		Log("logs/garage.log", string);
	}
	else if(!strcmp(params, "price", true, 5))
	{
    	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
	    if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ggedit price [garage] [price]");
        new idx = bizid;
		if(!GarageInfo[idx][gLevel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid garage id.");
		if(strcmp("The State", GarageInfo[bizid][gOwner])) return SendClientMessage(playerid, COLOR_GREY, "You can't edit the price of owned garage.");
	    GarageInfo[bizid][gPrice] = input;
	    format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
		UpdateDynamic3DTextLabelText(GarageInfo[bizid][gText], COLOR_WHITE, string);
	    format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set Garage ID %d's price to $%d.", RPN(playerid), bizid, input);
		SendAdminMessage(COLOR_DARKRED, 1, string);
		Log("logs/garage.log", string);
	}
	else if(!strcmp(params, "level", true, 5))
	{
		if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
	    if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ggedit level [garageid] [level]");
        new idx = bizid;
    	//if(!GarageInfo[bizid][hLevel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid garage id.");
    	if(input < 1 || input > 10) return SendClientMessage(playerid, COLOR_GREY, "Levels are between 1 and 10.");
	    GarageInfo[bizid][gLevel] = input;
        if(!strcmp("The State", GarageInfo[idx][gOwner])) format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
		else format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)\n"COE"\n"COE"Owner"CWE" %s", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner]);
		UpdateDynamic3DTextLabelText(GarageInfo[bizid][gText], COLOR_WHITE, string);
	    format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set garage ID %d's level to %d.", RPN(playerid), bizid, input);
		SendAdminMessage(COLOR_DARKRED, 1, string);
		Log("logs/garage.log", string);
	}
	return 1;
}
// End Garage CMDS


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
[/SPOILER]
Reply
#2

There is no
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
for commands
Reply
#3

IT DOESN'T WORK!!!
Reply
#4

Use this, fix the indentation though.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/compragarage", cmdtext, true) == 0)
{
    new string[128], done;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pGarage]) return SendClientMessage(playerid, COLOR_GREY, "You already own a garage.");
    for(new idx=1; idx<MAX_GARAGES; idx++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
        {
            if(!strcmp("The State", GarageInfo[idx][gOwner], false))
            {
                if(PlayerInfo[playerid][pMoney] < GarageInfo[idx][gPrice]) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to buy this garage.");
                GiveZaiatMoney(playerid, -GarageInfo[idx][gPrice]);
                if(PlayerInfo[playerid][pGarage]) PlayerInfo[playerid][pGarage] = idx;
                else PlayerInfo[playerid][pGarage] = idx;
                format(GarageInfo[idx][gOwner], 32, "%s", RPNU(playerid));
                format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner]);
                UpdateDynamic3DTextLabelText(GarageInfo[idx][gText], COLOR_WHITE, string);
                SendClientMessage(playerid, COLOR_GREEN, " You have successfully bought a garage.");
                format(string, sizeof(string), "%s has bought garage id %d.", RPN(playerid), idx);
                Log("logs/garage.log", string);
                idx = MAX_GARAGES;
                done = 1;
            }
            if(idx == MAX_GARAGES-1 && !done)
            {
                SendClientMessage(playerid, COLOR_GREY, "This garage is owned by someone else.");
            }
        }
        if(idx == MAX_GARAGES-1 && !done)
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not near a buyable garage.");
        }
    }
    return 1;
}

if(strcmp("/vendigarage", cmdtext, true) == 0)
{
    new string[128], done;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pGarage] && !PlayerInfo[playerid][pVHouse]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a house.");
    if(sscanf(params, "s[8]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellgaragetogov confirm");
    if(!strcmp(params, "confirm", true))
    {
        new idx = PlayerInfo[playerid][pGarage];
        if(IsPlayerInRangeOfPoint(playerid, 2, GarageInfo[PlayerInfo[playerid][pGarage]][gX], GarageInfo[PlayerInfo[playerid][pGarage]][gY], GarageInfo[PlayerInfo[playerid][pGarage]][gZ]))
        {
            GiveZaiatMoney(playerid, (75*GarageInfo[PlayerInfo[playerid][pGarage]][gPrice])/100);
            format(GarageInfo[PlayerInfo[playerid][pGarage]][gOwner], 32, "The State");
            format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: For Sale\nPrice: $%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
            UpdateDynamic3DTextLabelText(GarageInfo[PlayerInfo[playerid][pGarage]][gText], COLOR_WHITE, string);
            PlayerInfo[playerid][pGarage] = 0;
            SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your house to The State. (75 percent of the original price was paid back)");
            format(string, sizeof(string), "%s has sold house id %d to the market.", RPN(playerid), idx);
            Log("logs/garage.log", string);
            done = 1;
        }
        if(!done)
        {
            idx = PlayerInfo[playerid][pVHouse];
            if(IsPlayerInRangeOfPoint(playerid, 3, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]))
            {
                GiveZaiatMoney(playerid, (75*GarageInfo[idx][gPrice])/100);
                format(GarageInfo[idx][gOwner], 32, "The State");
                format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
                UpdateDynamic3DTextLabelText(GarageInfo[idx][gText], COLOR_WHITE, string);
                SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your garage to The State. (75 percent of the original price was paid back)");
                format(string, sizeof(string), "%s has sold garage id %d to the market.", RPN(playerid), idx);
                Log("logs/garage.log", string);
                done = 1;
            }
        }
        if(!done)
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not near your garage.");
            return 1;
        }
    }
    return 1;
}

if(strcmp("/creagarage", cmdtext, true) == 0)
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    for(new idx=1; idx<MAX_GARAGES; idx++)
    {
        if(!GarageInfo[idx][gLevel])
        {
            // Getting Garage Setup
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid, X, Y, Z);
            // Making Garage
            GarageInfo[idx][gLevel] = 1;
            GarageInfo[idx][gPrice] = 99999999;
            format(GarageInfo[idx][gOwner], 32, "The State");
            GarageInfo[idx][gX] = X;
            GarageInfo[idx][gY] = Y;
            GarageInfo[idx][gZ] = Z;
            GarageInfo[idx][gPickup] = CreateDynamicPickup(1277, 1, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ], 0);
            format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
            GarageInfo[idx][gText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]+0.3, 15);
            format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created garage ID %d.", RPN(playerid), idx);
            SendAdminMessage(COLOR_DARKRED, 1, string);
            Log("logs/garage.log", string);
            idx = MAX_GARAGES;
        }
    }
    return 1;
}

if(strcmp("/rimuovigarage", cmdtext, true) == 0)
{
    new id, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletegarage [garageid]");
    if(!GarageInfo[id][gLevel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid garage id.");
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i) && PlayerInfo[i][pGarage] == id)
        {
            PlayerInfo[i][pGarage] = 0;
            format(string, sizeof(string), " Administrator %s has deleted your garage.", RPN(playerid));
            SendClientMessage(i, COLOR_WHITE, string);
        }
    }
    if(!strcmp("The State", GarageInfo[id][gOwner]))
    {
        format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has deleted garage ID %d.", RPN(playerid), id);
    }
    else
    {
        format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has deleted %s's garage. (ID %d)", RPN(playerid), GarageInfo[id][gOwner], id);
    }
    SendAdminMessage(COLOR_DARKRED, 1, string);
    Log("logs/garage.log", string);
    GarageInfo[id][gLevel] = 0;
    GarageInfo[id][gPrice] = 0;
    format(GarageInfo[id][gOwner], 32, "");
    GarageInfo[id][gX] = 0;
    GarageInfo[id][gY] = 0;
    GarageInfo[id][gZ] = 0;
    DestroyDynamicPickup(GarageInfo[id][gPickup]);
    DestroyDynamic3DTextLabel(GarageInfo[id][gText]);
    return 1;
}

if(strcmp("/entra", cmdtext, true) == 0)
{
for(new idx=1; idx<MAX_GARAGES; idx++) // Dynamic Garages
    {
        if(IsPlayerInRangeOfPoint(playerid, 5, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ])/* && GetPlayerState(playerid) == PLAYER_STATE_DRIVER*/)
        {
            format(string, sizeof(string), "* %s enters the garage.", RPN(playerid));
            if(PlayerInfo[playerid][pMaskOn] == 1)
            {
               format(string, sizeof(string), "* Stranger enters the garage.");
            }
            else
            {
                format(string, sizeof(string), "* %s enters the garage.", RPN(playerid));
            }
            SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
            SetPlayerVirtualWorld(playerid, idx+500);
            //SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), idx+500);
            new vehicleid = GetPlayerVehicleID(playerid);
            if(GarageInfo[idx][gLevel] == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            if(GarageInfo[idx][gLevel] == 2)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            if(GarageInfo[idx][gLevel] == 3)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            if(GarageInfo[idx][gLevel] == 4)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            if(GarageInfo[idx][gLevel] == 5)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            if(GarageInfo[idx][gLevel] == 6)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            if(GarageInfo[idx][gLevel] == 7)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            if(GarageInfo[idx][gLevel] == 8)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            if(GarageInfo[idx][gLevel] == 9)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            if(GarageInfo[idx][gLevel] == 10)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(vehicleid, -2070.3000488281,-24,49.099998474121);
                    SetCameraBehindPlayer(playerid);
                    SetVehicleVirtualWorld(vehicleid, idx+500);
                }
                else
                {
                    SetPlayerPos(playerid, -2070.3000488281,-24,49.099998474121);
                    SetPlayerInterior(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                }
            }
            return 1;
        }
    }
    return 1;
}

if(strcmp("/saveproject", cmdtext, true) == 0)
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
    foreach(Player, i)
    SaveGarages();
    format(string, sizeof(string), "{FF0000}[Manual Save]{FF6347} Your Project has manualy saved!");
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    return 1;
}

if(strcmp("/idgarage", cmdtext, true) == 0)
{
    new bizid, string[128], input;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    if(sscanf(params, "s[32]", params))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit [option] [garageid]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: location | price | level");
        return 1;
    }
    if(!strcmp(params, "location", true, 8))
    {
        if(sscanf(params, "s[32]i", params, bizid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ggedit location [house]");
        new idx = bizid;
        if(!GarageInfo[bizid][gLevel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid garage id.");
        GetPlayerPos(playerid, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]);
        DestroyDynamicPickup(GarageInfo[idx][gPickup]);
        GarageInfo[idx][gPickup] = CreateDynamicPickup(1277, 1, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ], 0);
        DestroyDynamic3DTextLabel(GarageInfo[idx][gText]);
        if(!strcmp("The State", GarageInfo[idx][gOwner])) format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
        else format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner]);
        GarageInfo[idx][gText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]+0.3, 15);
        format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has changed garage ID %d's location.", RPN(playerid), bizid);
        SendAdminMessage(COLOR_DARKRED, 1, string);
        Log("logs/garage.log", string);
    }
    else if(!strcmp(params, "price", true, 5))
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
        if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ggedit price [garage] [price]");
        new idx = bizid;
        if(!GarageInfo[idx][gLevel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid garage id.");
        if(strcmp("The State", GarageInfo[bizid][gOwner])) return SendClientMessage(playerid, COLOR_GREY, "You can't edit the price of owned garage.");
        GarageInfo[bizid][gPrice] = input;
        format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
        UpdateDynamic3DTextLabelText(GarageInfo[bizid][gText], COLOR_WHITE, string);
        format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set Garage ID %d's price to $%d.", RPN(playerid), bizid, input);
        SendAdminMessage(COLOR_DARKRED, 1, string);
        Log("logs/garage.log", string);
    }
    else if(!strcmp(params, "level", true, 5))
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login RCON.");
        if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ggedit level [garageid] [level]");
        new idx = bizid;
        //if(!GarageInfo[bizid][hLevel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid garage id.");
        if(input < 1 || input > 10) return SendClientMessage(playerid, COLOR_GREY, "Levels are between 1 and 10.");
        GarageInfo[bizid][gLevel] = input;
        if(!strcmp("The State", GarageInfo[idx][gOwner])) format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)"COE"]\n"COE"Owner"CWE" %s\nStatus: For Sale\n"CWE"$%d", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner], GarageInfo[idx][gPrice]);
        else format(string, sizeof(string), ""COE"["CWE"%d, Garage (Lvl: %d)\n"COE"\n"COE"Owner"CWE" %s", idx, GarageInfo[idx][gLevel], GarageInfo[idx][gOwner]);
        UpdateDynamic3DTextLabelText(GarageInfo[bizid][gText], COLOR_WHITE, string);
        format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set garage ID %d's level to %d.", RPN(playerid), bizid, input);
        SendAdminMessage(COLOR_DARKRED, 1, string);
        Log("logs/garage.log", string);
    }
    return 1;
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)