CMDMessage to the admins & some other issue's
#1

Код:
stock CMDMessageToAdmins(color, const len[])

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][AdminLevel] >= 1) SendClientMessage(i, color, len);
}
return 1;
}
So i'm trying to add this stock to my script, but its unable to compile... Does someone has the solution or another way, to send an CMDMessage to the admins?

This is the format I want to use:
Код:
ADMIN: %s is now spectating %s
ADMIN: %s has spawned a %s
etc etc

Pleo helped me with what to get by the command:
Код:
new string[128];
format(string, sizeof string, "ADMIN: %s has spawned a %s", adminname, carname);
CMDMessageToAdmins(COLOR_ADMINCOMMAND, string);
But where to add that? Here the command where I want to add it:

Код:
if(strcmp(cmd, "/veh", true) == 0)
	{
	    if(!(PlayerInfo[playerid][pAdmin] >= 4))
			return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");

	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp))
	        return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [vehicle name/ID] [color1(optional)] [color2(optional)] [respawnable(optional)]");

		new car = ReturnVehicleModelID(tmp);
		if(!car)
			return SendClientMessage(playerid, COLOR_GREY, "   Invalid vehicle model name/ID.");

	    new color1, color2;
	    tmp = strtok(cmdtext, idx);
	    if(!strlen(tmp))
		{
	        color1 = -1;
	        color2 = -1;
		}
		else
		{
			color1 = strval(tmp);
			if(color1 < -1 || color1 > 200)
				return SendClientMessage(playerid, COLOR_GREY, "   Enter a valid color [0-200]");

	    	tmp = strtok(cmdtext, idx);
	    	if(!strlen(tmp)) color2 = color1;
	    	else color2 = strval(tmp);
	    	if(color2 < -1 || color2 > 200)
				return SendClientMessage(playerid, COLOR_GREY, "   Enter a valid color [0-200]");
		}

		if(IsPlayerInAnyVehicle(playerid))
		    RemovePlayerFromVehicle(playerid);
 		new	Float:X, Float:Y, Float:Z, Float:A;
        GetPlayerPos(playerid, X,Y,Z);
		GetPlayerFacingAngle(playerid,A);
		new carid = CreateVehicle(car, X,Y,Z,A, color1, color2, -1);
	    tmp = strtok(cmdtext, idx);
	    if(strval(tmp) != 1)
	    {
	        gDestroyVehicle[carid] = 1;
		}
		gCarLock[carid] = 0;
		PutPlayerInVehicle(playerid,carid,0);
		LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
		for(new i = 0; i < sizeof(CreatedCars); i++)
		{
		    if(CreatedCars[i] == INVALID_VEHICLE_ID)
		    {
		        CreatedCars[i] = carid;
				break;
			}
		}
		return 1;
	}
I also want this with spec:
Код:
ADMIN: %s is now spectating &s
Where/how to add this on this command:

Код:
if(strcmp(cmd, "/spec", true) == 0 || strcmp(cmd, "/recon", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] < 1)
			{
				SendClientMessage(playerid, COLOR_GREY, "   You are not authorized to use that command !");
				return 1;
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /spec [playerid/off]");
				return 1;
			}
			
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerNPC(giveplayerid)) return 1;
			if(strcmp("off", tmp, true, strlen(tmp)) == 0)
			{
			    if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
			    {
			        SendClientMessage(playerid, COLOR_LIGHTRED, "   You are not spectating anyone !");
					return 1;
			    }
			
			    SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
				SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
				SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
				SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
			    SetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
				SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
				SendClientMessage(playerid, COLOR_LIGHTRED, "You are no longer spectating.");
			    TogglePlayerSpectating(playerid, 0);
			    SpectatedID[playerid] = INVALID_PLAYER_ID;
			    SpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
			    HidePM[playerid] = 0;
				PhoneOnline[playerid] = 0;
				ResetPlayerAdminWeaponsEx(playerid);
			    return 1;
			}
			if(IsPlayerConnected(giveplayerid))
			{
				if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
				{
				    PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
				    GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
					GetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
					GetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
					GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
				}
				SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
				SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
				TogglePlayerSpectating(playerid, 1);
				SpectatedID[playerid] = giveplayerid;
				HidePM[playerid] = 1;
				PhoneOnline[playerid] = 1;
				if(IsPlayerInAnyVehicle(giveplayerid))
				{
				    PlayerSpectateVehicle(playerid, GetPlayerVehicleID(giveplayerid));
				    SpectateType[playerid] = ADMIN_SPEC_TYPE_VEHICLE;
				}
				else
				{
				    PlayerSpectatePlayer(playerid, giveplayerid);
				    SpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   That player isn't active !");
			    return 1;
			}
	    }
	    return 1;
	}
At least, how to add a textdraw or something? A little text above a player's name... like "Administrator".

If someone give his attention to me, I will highly appericate it.

Thanks!
Reply
#2

pawn Код:
forward SendAdminMessage(color,const string[],level); // We are forwarded it

// This down is to send message to admins when someone do something
format(string, 256, "[ADMIN] %s is now spectating %s",spectator , spectating);
SendAdminMessage(-1,string,1);

// We need to make public command now
public SendAdminMessage(color,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if (PlayerInfo[i][pAdmin] >= level)
            {
                SendClientMessage(i, color, string);
                printf("%s", string);
            }
        }
    }
    return 1;
}
Reply
#3

So where to paste that? Can you add it to my commands in the code?
Reply
#4

A question.. Do you have a function to get the vehicle's name or shall I post it for you ?
Reply
#5

No, and idk how to add it nor to use it with further scripts.

I kinda lost my experience
Reply
#6

Quote:
Originally Posted by Stereotype
Посмотреть сообщение
pawn Код:
forward SendAdminMessage(color,const string[],level); // We are forwarded it

// This down is to send message to admins when someone do something
format(string, 256, "[ADMIN] %s is now spectating %s",spectator , spectating);
SendAdminMessage(-1,string,1);

// We need to make public command now
public SendAdminMessage(color,const string[],level)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if (PlayerInfo[i][pAdmin] >= level)
            {
                SendClientMessage(i, color, string);
                printf("%s", string);
            }
        }
    }
    return 1;
}
Why you made a public function for that ? It can be made with a stock easily
pawn Код:
stock CMDMessageToAdmins(color,Message[])
{
    for(new i; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] >= 1) SendClientMessage(i, color, Message);
    return 1;
}
Replace your function with this one

And If you don't have a function to get the vehicle name here it is
pawn Код:
stock GetVehicleName(vehiclemodel)
{
    new const VehicleNames[][] =
    {
       "Landstalker", "Bravura", "Buffalo", "Linerunner", "Pereniel", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus","Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Mr Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer",
       "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy",
       "Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR3 50", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick",
       "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropdust",
       "Stunt", "Tanker", "RoadTrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet",
       "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster A", "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight", "Trailer", "Kart", "Mower",
       "Duneride", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "Newsvan", "Tug", "Trailer A", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Trailer B", "Trailer C", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)", "Police Car (LVPD)", "Police Ranger",
       "Picador", "S.W.A.T. Van", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A", "Luggage Trailer B", "Stair Trailer", "Boxville", "Farm Plow", "Utility Trailer"
    };
    new VName[30]; format(VName, sizeof(VName), "%s", VehicleNames[vehiclemodel-400]);
    return _:VName;
}
And your code..
pawn Код:
if(strcmp(cmd, "/veh", true) == 0)
    {
        if(!(PlayerInfo[playerid][pAdmin] >= 4))
            return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [vehicle name/ID] [color1(optional)] [color2(optional)] [respawnable(optional)]");

        new car = ReturnVehicleModelID(tmp);
        if(!car)
            return SendClientMessage(playerid, COLOR_GREY, "   Invalid vehicle model name/ID.");

        new color1, color2;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            color1 = -1;
            color2 = -1;
        }
        else
        {
            color1 = strval(tmp);
            if(color1 < -1 || color1 > 200)
                return SendClientMessage(playerid, COLOR_GREY, "   Enter a valid color [0-200]");

            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) color2 = color1;
            else color2 = strval(tmp);
            if(color2 < -1 || color2 > 200)
                return SendClientMessage(playerid, COLOR_GREY, "   Enter a valid color [0-200]");
        }

        if(IsPlayerInAnyVehicle(playerid))
            RemovePlayerFromVehicle(playerid);
        new Float:X, Float:Y, Float:Z, Float:A;
        GetPlayerPos(playerid, X,Y,Z);
        GetPlayerFacingAngle(playerid,A);
        new carid = CreateVehicle(car, X,Y,Z,A, color1, color2, -1);
       
        new playeridname[MAX_PLAYER_NAME]; GetPlayerName(playerid, playeridname, MAX_PLAYER_NAME);
        new string[128]; format(string, sizeof string, "ADMIN: %s has spawned a %s", playeridname, GetVehicleName(GetVehicleModel(carid)));
        CMDMessageToAdmins(COLOR_ADMINCOMMAND, string);
       
        tmp = strtok(cmdtext, idx);
        if(strval(tmp) != 1)
        {
            gDestroyVehicle[carid] = 1;
        }
        gCarLock[carid] = 0;
        PutPlayerInVehicle(playerid,carid,0);
        LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
        for(new i = 0; i < sizeof(CreatedCars); i++)
        {
            if(CreatedCars[i] == INVALID_VEHICLE_ID)
            {
                CreatedCars[i] = carid;
                break;
            }
        }
        return 1;
    }
   
    if(strcmp(cmd, "/spec", true) == 0 || strcmp(cmd, "/recon", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not authorized to use that command !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /spec [playerid/off]");
                return 1;
            }

            giveplayerid = ReturnUser(tmp);
            if(IsPlayerNPC(giveplayerid)) return 1;
            if(strcmp("off", tmp, true, strlen(tmp)) == 0)
            {
                if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "   You are not spectating anyone !");
                    return 1;
                }

                SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
                SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
                SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
                SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
                SetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
                SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
                SendClientMessage(playerid, COLOR_LIGHTRED, "You are no longer spectating.");
                TogglePlayerSpectating(playerid, 0);
                SpectatedID[playerid] = INVALID_PLAYER_ID;
                SpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
                HidePM[playerid] = 0;
                PhoneOnline[playerid] = 0;
                ResetPlayerAdminWeaponsEx(playerid);
                return 1;
            }
            if(IsPlayerConnected(giveplayerid))
            {
                if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
                {
                    PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
                    GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
                    GetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
                    GetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
                    GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
                }
                SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
                SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
                TogglePlayerSpectating(playerid, 1);
                SpectatedID[playerid] = giveplayerid;
                HidePM[playerid] = 1;
                PhoneOnline[playerid] = 1;
                if(IsPlayerInAnyVehicle(giveplayerid))
                {
                    PlayerSpectateVehicle(playerid, GetPlayerVehicleID(giveplayerid));
                    SpectateType[playerid] = ADMIN_SPEC_TYPE_VEHICLE;
                }
                else
                {
                    PlayerSpectatePlayer(playerid, giveplayerid);
                    SpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
                }
               
                new playeridname[MAX_PLAYER_NAME]; GetPlayerName(playerid, playeridname, MAX_PLAYER_NAME);
                new giveplayeridname[MAX_PLAYER_NAME]; GetPlayerName(playerid, giveplayeridname, MAX_PLAYER_NAME);
                new string[128]; format(string, sizeof string, "ADMIN: %s is now spectating %s", playeridname, giveplayeridname);
                CMDMessageToAdmins(COLOR_ADMINCOMMAND, string);
            }
            else return SendClientMessage(playerid, COLOR_GREY, "   That player isn't active !");
        }
        return 1;
    }
Quote:
Originally Posted by Screaming
Посмотреть сообщение
How to add a textdraw or something? A little text above a player's name... like "Administrator".
Make a 3DTextLabel And attach it to the player
Reply
#7

I replaced my spec code, with yours & added the stock at the end of the script + the GetVehichleName at the end of the script.

Unable to compile.
Reply
#8

Post the errors and codes with them please..
Reply
#9

Код:
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(3997) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(4011) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(4417) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(4432) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(4486) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(4580) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(4590) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(4708) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(11584) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(11622) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12647) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12648) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12692) : warning 204: symbol is assigned a value that is never used: "carid"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12693) : warning 204: symbol is assigned a value that is never used: "tires"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12691) : warning 203: symbol is never used: "lights"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12691) : warning 203: symbol is never used: "doors"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12691) : warning 203: symbol is never used: "panels"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12708) : warning 204: symbol is assigned a value that is never used: "carid"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12709) : warning 204: symbol is assigned a value that is never used: "tires"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12707) : warning 203: symbol is never used: "lights"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12707) : warning 203: symbol is never used: "doors"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(12707) : warning 203: symbol is never used: "panels"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(13627) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(19298) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(19376) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(20701) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(20720) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(20790) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25075) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25101) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25126) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25172) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25186) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25218) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25220) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25249) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25252) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25255) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25267) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25272) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25285) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25289) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25297) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25325) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25337) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25909) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25979) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25986) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(25993) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(26767) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(26793) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(26822) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(26824) : warning 204: symbol is assigned a value that is never used: "vehicle"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28585) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28604) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28604) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28631) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28631) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28653) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28653) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28674) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28674) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28694) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28694) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28715) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28715) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28738) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28738) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28761) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28761) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28787) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28787) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28817) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(28817) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(29454) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(29495) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(29495) : warning 202: number of arguments does not match definition
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(29495) : warning 202: number of arguments does not match definition
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(29516) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(30366) : warning 204: symbol is assigned a value that is never used: "rands"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(42051) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(42093) : warning 217: loose indentation
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(43656) : warning 204: symbol is assigned a value that is never used: "result"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(44490) : error 017: undefined symbol "AdminLevel"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(44493) : warning 203: symbol is never used: "PlayerDrunk"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(44493) : warning 203: symbol is never used: "iOrder"
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(16233) : warning 204: symbol is assigned a value that is never used: "iTGB"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Stocks at the end:
Код:
stock CMDMessageToAdmins(color,Message[])
{
    for(new i; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] >= 1) SendClientMessage(i, color, Message);
    return 1;
}

stock GetVehicleName(vehiclemodel)
{
    new const VehicleNames[][] =
    {
       "Landstalker", "Bravura", "Buffalo", "Linerunner", "Pereniel", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus","Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Mr Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer",
       "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy",
       "Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR3 50", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick",
       "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking", "Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropdust",
       "Stunt", "Tanker", "RoadTrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent", "Bullet",
       "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster A", "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight", "Trailer", "Kart", "Mower",
       "Duneride", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "Newsvan", "Tug", "Trailer A", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Trailer B", "Trailer C", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)", "Police Car (LVPD)", "Police Ranger",
       "Picador", "S.W.A.T. Van", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A", "Luggage Trailer B", "Stair Trailer", "Boxville", "Farm Plow", "Utility Trailer"
    };
    new VName[30]; format(VName, sizeof(VName), "%s", VehicleNames[vehiclemodel-400]);
    return _:VName;
}
/spec:
Код:
if(strcmp(cmd, "/spec", true) == 0 || strcmp(cmd, "/recon", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not authorized to use that command !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /spec [playerid/off]");
                return 1;
            }

            giveplayerid = ReturnUser(tmp);
            if(IsPlayerNPC(giveplayerid)) return 1;
            if(strcmp("off", tmp, true, strlen(tmp)) == 0)
            {
                if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "   You are not spectating anyone !");
                    return 1;
                }

                SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
                SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
                SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
                SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
                SetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
                SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
                SendClientMessage(playerid, COLOR_LIGHTRED, "You are no longer spectating.");
                TogglePlayerSpectating(playerid, 0);
                SpectatedID[playerid] = INVALID_PLAYER_ID;
                SpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
                HidePM[playerid] = 0;
                PhoneOnline[playerid] = 0;
                ResetPlayerAdminWeaponsEx(playerid);
                return 1;
            }
            if(IsPlayerConnected(giveplayerid))
            {
                if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
                {
                    PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
                    GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
                    GetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
                    GetPlayerPos(playerid, PlayerInfo[playerid][pSPos_x], PlayerInfo[playerid][pSPos_y], PlayerInfo[playerid][pSPos_z]);
                    GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSPos_r]);
                }
                SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
                SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
                TogglePlayerSpectating(playerid, 1);
                SpectatedID[playerid] = giveplayerid;
                HidePM[playerid] = 1;
                PhoneOnline[playerid] = 1;
                if(IsPlayerInAnyVehicle(giveplayerid))
                {
                    PlayerSpectateVehicle(playerid, GetPlayerVehicleID(giveplayerid));
                    SpectateType[playerid] = ADMIN_SPEC_TYPE_VEHICLE;
                }
                else
                {
                    PlayerSpectatePlayer(playerid, giveplayerid);
                    SpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
                }

                new playeridname[MAX_PLAYER_NAME]; GetPlayerName(playerid, playeridname, MAX_PLAYER_NAME);
                new giveplayeridname[MAX_PLAYER_NAME]; GetPlayerName(playerid, giveplayeridname, MAX_PLAYER_NAME);
                new string[128]; format(string, sizeof string, "ADMIN: %s is now spectating %s", playeridname, giveplayeridname);
                CMDMessageToAdmins(COLOR_ADMINCOMMAND, string);
            }
            else return SendClientMessage(playerid, COLOR_GREY, "   That player isn't active !");
        }
        return 1;
    }
/veh

Код:
if(strcmp(cmd, "/veh", true) == 0)
    {
        if(!(PlayerInfo[playerid][pAdmin] >= 4))
            return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use this command.");

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [vehicle name/ID] [color1(optional)] [color2(optional)] [respawnable(optional)]");

        new car = ReturnVehicleModelID(tmp);
        if(!car)
            return SendClientMessage(playerid, COLOR_GREY, "   Invalid vehicle model name/ID.");

        new color1, color2;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            color1 = -1;
            color2 = -1;
        }
        else
        {
            color1 = strval(tmp);
            if(color1 < -1 || color1 > 200)
                return SendClientMessage(playerid, COLOR_GREY, "   Enter a valid color [0-200]");

            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) color2 = color1;
            else color2 = strval(tmp);
            if(color2 < -1 || color2 > 200)
                return SendClientMessage(playerid, COLOR_GREY, "   Enter a valid color [0-200]");
        }

        if(IsPlayerInAnyVehicle(playerid))
            RemovePlayerFromVehicle(playerid);
        new Float:X, Float:Y, Float:Z, Float:A;
        GetPlayerPos(playerid, X,Y,Z);
        GetPlayerFacingAngle(playerid,A);
        new carid = CreateVehicle(car, X,Y,Z,A, color1, color2, -1);

        new playeridname[MAX_PLAYER_NAME]; GetPlayerName(playerid, playeridname, MAX_PLAYER_NAME);
        new string[128]; format(string, sizeof string, "ADMIN: %s has spawned a %s", playeridname, GetVehicleName(GetVehicleModel(carid)));
        CMDMessageToAdmins(COLOR_ADMINCOMMAND, string);

        tmp = strtok(cmdtext, idx);
        if(strval(tmp) != 1)
        {
            gDestroyVehicle[carid] = 1;
        }
        gCarLock[carid] = 0;
        PutPlayerInVehicle(playerid,carid,0);
        LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
        for(new i = 0; i < sizeof(CreatedCars); i++)
        {
            if(CreatedCars[i] == INVALID_VEHICLE_ID)
            {
                CreatedCars[i] = carid;
                break;
            }
        }
        return 1;
    }
Without your codes, it can compile fine

EDIT:

It seems he can't find "AdminLevel"

Код:
C:\Users\Justin\Desktop\CR-RP(LS)\GameModes\GLRP.pwn(44490) : error 017: undefined symbol "AdminLevel"
How to fix that?
Reply
#10

You don't have an admin system ? an enum ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)