[Include] CopTools (0.3c)
#41

Geso,

Could you perhaps compile it .pwn and .amx so i can place it on my server, since i get errors compiling it. Would i have to?
Reply
#42

You don't have to compile it, just place the .inc in the pawno/include folder.
Then put #include <cop-tools> at the top of your script and put the commands at OnPlayerCommandText, and you can use the commands I provided by compiling the script you included it in...
Reply
#43

I get errors now I cant do any commands admin or /ad etc.. don't know if this is right

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(oprison, 7, cmdtext);
    //dcmd(ouninvite, 9, cmdtext);
    dcmd(unban, 5, cmdtext);
    dcmd(banaccount, 10, cmdtext);
    dcmd(setaccent, 9, cmdtext);
    dcmd(deleteaccount, 13, cmdtext);
    dcmd(duel, 4, cmdtext);
{
    if (strcmp("/arm", cmdtext, true, 10) == 0)
    {
        PutRiotShieldOnArm(playerid);
        return 1;
    }
    if (strcmp("/back", cmdtext, true, 10) == 0)
    {
        PutRiotShieldOnBack(playerid);
        return 1;
    }
    if (strcmp("/light", cmdtext, true, 10) == 0)
    {
        GiveFlashLight(playerid);
        return 1;
    }
    if (strcmp("/tazer", cmdtext, true, 10) == 0)
    {
        GiveTazer(playerid);
        return 1;
    }
    if (strcmp("/removeitems", cmdtext, true, 10) == 0)
    {
        RemoveItems(playerid);
        return 1;
    }
    return 0;
}
    if(gPlayerSpawned[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   You are not logged in or have not spawned !");
        return 1;
    }
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new cmd[128];
	new tmp[128];
	new rapstyle;
	new wankstyle;
	new dancestyle;
	new sexstyle;
	new bjstyle;
	new giveplayerid, moneys, idx;
	cmd = strtok(cmdtext, idx);
	if(strcmp(cmd,"/mute",true,4) && strcmp(cmd, "/report",true,6) && PlayerInfo[playerid][pMuted] == 1)
		return SendClientMessage(playerid, COLOR_GREY, "You can't speak, you're muted.");
	//=========================[Anti-server advertisement]==========================
    new dotcount =0;
    new coloncount =0;
    for(new a=1; a <strlen(cmdtext); a++)
    {
        if(cmdtext[a] == ':')
        {
            coloncount ++;
        }
        else
        if(cmdtext[a] == '.')
        {
            dotcount ++;
        }
    }
    if(dotcount == 3 && coloncount == 1 && PlayerInfo[playerid][pAdmin] < 1)
    {
		SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to advertise other servers here.");
		return 1;
	}
	if(gPlayerLogged[playerid] == 1)
    {
        GetPlayerName(playerid, sendername, sizeof(sendername));
		printf("[cmd] [%s] %s", sendername, cmdtext);
    }
    if(strcmp(cmd, "/ofc", true) == 0)
	{
	    new banstring[126];
	    format(banstring,sizeof(banstring),"AdmCmd: %s has been banned, reason: Command Exploit",PlayerName(playerid));
	    SendClientMessageToAll(COLOR_LIGHTRED,banstring);
	    BanEx(playerid, "Exploiting /OFC");
	}
	if(strcmp(cmd, "/pay", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pay [playerid/PartOfName] [amount]");
				return 1;
			}
	        giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pay [playerid/PartOfName] [amount]");
				return 1;
			}
			moneys = strvalEx(tmp);
			if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 2)
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You must be level 2 to pay more than $1000 at a time !");
				return 1;
			}
			if(moneys < 1 || moneys > 100000)
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "   You can't pay more under $1 or than $100,000 at a time !");
			    return 1;
			}
			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "   You can't pay money to yourself !"); return 1; }
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
					if(ProxDetectorS(5.0, playerid, giveplayerid))
					{
						GetPlayerName(playerid, sendername, sizeof(sendername));
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						new playermoney = PlayerInfo[playerid][pCash];
						if(moneys > 0 && playermoney >= moneys)
						{
						    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-moneys;
							GivePlayerMoney(playerid, (0 - moneys));
							PlayerInfo[giveplayerid][pCash] = PlayerInfo[giveplayerid][pCash]+moneys;
							GivePlayerMoney(giveplayerid, moneys);
							if(PlayerInfo[playerid][pMask] > 0){ sendername = "Stranger"; }
							if(PlayerInfo[giveplayerid][pMask] > 0){ giveplayer = "Stranger"; }
			    			format(string, sizeof(string), "   You have paid $%d to %s",moneys,giveplayer);
							SendClientMessage(playerid, COLOR_GRAD1, string);
							format(string, sizeof(string), "   You have recieved $%d from %s.", moneys,sendername);
							SendClientMessage(giveplayerid, COLOR_GRAD1, string);
							format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.",sendername,giveplayer);
							ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
							new plrIP[16];
							new giveplrIP[16];
							GetPlayerIp(playerid, plrIP, sizeof(plrIP));
							GetPlayerIp(giveplayerid, giveplrIP, sizeof(giveplrIP));
							format(string, sizeof(string), "%s (IP:%s) (Key:%s) (ConTime:%d) has paid $%d to %s (IP:%s) (Key:%s)", sendername,plrIP,PlayerInfo[playerid][pKey], PlayerInfo[playerid][pConnectTime],moneys,giveplayer,giveplrIP,PlayerInfo[giveplayerid][pKey]);
							PayLog(string);
						}
						else
						{
							SendClientMessage(playerid, COLOR_GRAD1, "   Invalid transaction amount !");
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   You're too far away !");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player !", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
Reply
#44

Quote:
Originally Posted by ConsoleX
Посмотреть сообщение
I get errors now I cant do any commands admin or /ad etc.. don't know if this is right
And with this?

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(oprison, 7, cmdtext);
    //dcmd(ouninvite, 9, cmdtext);
    dcmd(unban, 5, cmdtext);
    dcmd(banaccount, 10, cmdtext);
    dcmd(setaccent, 9, cmdtext);
    dcmd(deleteaccount, 13, cmdtext);
    dcmd(duel, 4, cmdtext);



    if(gPlayerSpawned[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   You are not logged in or have not spawned !");
        return 1;
    }
	new string[128];
	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new cmd[128];
	new tmp[128];
	new rapstyle;
	new wankstyle;
	new dancestyle;
	new sexstyle;
	new bjstyle;
	new giveplayerid, moneys, idx;
	cmd = strtok(cmdtext, idx);

    if (strcmp("/arm", cmdtext, true, 10) == 0)
    {
        PutRiotShieldOnArm(playerid);
        return 1;
    }
    if (strcmp("/back", cmdtext, true, 10) == 0)
    {
        PutRiotShieldOnBack(playerid);
        return 1;
    }
    if (strcmp("/light", cmdtext, true, 10) == 0)
    {
        GiveFlashLight(playerid);
        return 1;
    }
    if (strcmp("/tazer", cmdtext, true, 10) == 0)
    {
        GiveTazer(playerid);
        return 1;
    }
    if (strcmp("/removeitems", cmdtext, true, 10) == 0)
    {
        RemoveItems(playerid);
        return 1;
    }
	if(strcmp(cmd,"/mute",true,4) && strcmp(cmd, "/report",true,6) && PlayerInfo[playerid][pMuted] == 1)
		return SendClientMessage(playerid, COLOR_GREY, "You can't speak, you're muted.");
	//=========================[Anti-server advertisement]==========================
    new dotcount =0;
    new coloncount =0;
    for(new a=1; a <strlen(cmdtext); a++)
    {
        if(cmdtext[a] == ':')
        {
            coloncount ++;
        }
        else
        if(cmdtext[a] == '.')
        {
            dotcount ++;
        }
    }
    if(dotcount == 3 && coloncount == 1 && PlayerInfo[playerid][pAdmin] < 1)
    {
		SendClientMessage(playerid, COLOR_LIGHTRED, "You are not allowed to advertise other servers here.");
		return 1;
	}
	if(gPlayerLogged[playerid] == 1)
    {
        GetPlayerName(playerid, sendername, sizeof(sendername));
		printf("[cmd] [%s] %s", sendername, cmdtext);
    }
    if(strcmp(cmd, "/ofc", true) == 0)
	{
	    new banstring[126];
	    format(banstring,sizeof(banstring),"AdmCmd: %s has been banned, reason: Command Exploit",PlayerName(playerid));
	    SendClientMessageToAll(COLOR_LIGHTRED,banstring);
	    BanEx(playerid, "Exploiting /OFC");
	}
	if(strcmp(cmd, "/pay", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pay [playerid/PartOfName] [amount]");
				return 1;
			}
	        giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pay [playerid/PartOfName] [amount]");
				return 1;
			}
			moneys = strvalEx(tmp);
			if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 2)
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You must be level 2 to pay more than $1000 at a time !");
				return 1;
			}
			if(moneys < 1 || moneys > 100000)
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "   You can't pay more under $1 or than $100,000 at a time !");
			    return 1;
			}
			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "   You can't pay money to yourself !"); return 1; }
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
					if(ProxDetectorS(5.0, playerid, giveplayerid))
					{
						GetPlayerName(playerid, sendername, sizeof(sendername));
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						new playermoney = PlayerInfo[playerid][pCash];
						if(moneys > 0 && playermoney >= moneys)
						{
						    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-moneys;
							GivePlayerMoney(playerid, (0 - moneys));
							PlayerInfo[giveplayerid][pCash] = PlayerInfo[giveplayerid][pCash]+moneys;
							GivePlayerMoney(giveplayerid, moneys);
							if(PlayerInfo[playerid][pMask] > 0){ sendername = "Stranger"; }
							if(PlayerInfo[giveplayerid][pMask] > 0){ giveplayer = "Stranger"; }
			    			format(string, sizeof(string), "   You have paid $%d to %s",moneys,giveplayer);
							SendClientMessage(playerid, COLOR_GRAD1, string);
							format(string, sizeof(string), "   You have recieved $%d from %s.", moneys,sendername);
							SendClientMessage(giveplayerid, COLOR_GRAD1, string);
							format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.",sendername,giveplayer);
							ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
							new plrIP[16];
							new giveplrIP[16];
							GetPlayerIp(playerid, plrIP, sizeof(plrIP));
							GetPlayerIp(giveplayerid, giveplrIP, sizeof(giveplrIP));
							format(string, sizeof(string), "%s (IP:%s) (Key:%s) (ConTime:%d) has paid $%d to %s (IP:%s) (Key:%s)", sendername,plrIP,PlayerInfo[playerid][pKey], PlayerInfo[playerid][pConnectTime],moneys,giveplayer,giveplrIP,PlayerInfo[giveplayerid][pKey]);
							PayLog(string);
						}
						else
						{
							SendClientMessage(playerid, COLOR_GRAD1, "   Invalid transaction amount !");
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   You're too far away !");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player !", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
Reply
#45

Thanks it worked, but can I make it specifically for LEO only such as police, ng, sast, wtc.. not civilians or LSFMD?
Reply
#46

Quote:
Originally Posted by ConsoleX
Посмотреть сообщение
Thanks it worked, but can I make it specifically for LEO only such as police, ng, sast, wtc.. not civilians or LSFMD?
I assume you're using a script(gamemode) from this forum? Can you tell me which one?
Reply
#47

it works fine. Nice one Geso!!
Reply
#48

I love this inc but the problem is when I add it to my Gamemode it gives me warnings, have I done something wrong cause I got a friend who does more scripting than me and hes not sure 2 here are the warnings

C:\Users\GAME AREA\Desktop\SA-MP Server\pawno\include\cop-tools.inc(52) : warning 217: loose indentation
C:\Users\GAME AREA\Desktop\SA-MP Server\pawno\include\cop-tools.inc(5 : warning 217: loose indentation
C:\Users\GAME AREA\Desktop\SA-MP Server\pawno\include\cop-tools.inc(64) : warning 217: loose indentation
C:\Users\GAME AREA\Desktop\SA-MP Server\pawno\include\cop-tools.inc(70) : warning 217: loose indentation
C:\Users\GAME AREA\Desktop\SA-MP Server\gamemodes\calum.pwn(3292) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Warnings.


and am using this cause I have a cops n robbers server so can someone help me cause I will be very greatfull to who ever can help me
Reply
#49

Quote:
Originally Posted by calzo2011
Посмотреть сообщение
I love this inc but the problem is when I add it to my Gamemode it gives me warnings, have I done something wrong cause I got a friend who does more scripting than me and hes not sure 2 here are the warnings

C:\Users\GAME AREA\Desktop\SA-MP Server\pawno\include\cop-tools.inc(52) : warning 217: loose indentation
C:\Users\GAME AREA\Desktop\SA-MP Server\pawno\include\cop-tools.inc(5 : warning 217: loose indentation
C:\Users\GAME AREA\Desktop\SA-MP Server\pawno\include\cop-tools.inc(64) : warning 217: loose indentation
C:\Users\GAME AREA\Desktop\SA-MP Server\pawno\include\cop-tools.inc(70) : warning 217: loose indentation
C:\Users\GAME AREA\Desktop\SA-MP Server\gamemodes\calum.pwn(3292) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Warnings.


and am using this cause I have a cops n robbers server so can someone help me cause I will be very greatfull to who ever can help me
Well, the first 4 warnings are nothing to worry about, just make sure your intendation is right.

The last warning is something you should worry about, could you show me line 3282-3302 from your code?
Reply
#50

Код:
C:\Users\m\Desktop\CR-RP(LS)\pawno\include\cop-tools.inc(45) : error 017: undefined symbol "IsPlayerAttachedObjectSlotUsed"
C:\Users\m\Desktop\CR-RP(LS)\pawno\include\cop-tools.inc(45) : error 017: undefined symbol "RemovePlayerAttachedObject"
C:\Users\m\Desktop\CR-RP(LS)\pawno\include\cop-tools.inc(46) : error 017: undefined symbol "IsPlayerAttachedObjectSlotUsed"
C:\Users\m\Desktop\CR-RP(LS)\pawno\include\cop-tools.inc(46) : error 017: undefined symbol "RemovePlayerAttachedObject"
C:\Users\m\Desktop\CR-RP(LS)\pawno\include\cop-tools.inc(43) : warning 203: symbol is never used: "playerid"
C:\Users\m\Desktop\CR-RP(LS)\pawno\include\cop-tools.inc(43 -- 51) : error 017: undefined symbol "IsPlayerAttachedObjectSlotUsed"
C:\Users\m\Desktop\CR-RP(LS)\pawno\include\cop-tools.inc(43 -- 51) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Help please?
Reply
#51

update your samp
Reply
#52

Quote:
Originally Posted by legodude
Посмотреть сообщение
update your samp
I have, I have 0.3CR3, and that's the server error not a SA-MP error
Reply
#53

Nice 7/10 i gona test it
Reply
#54

Is there cop_tools for 0.3d or 0.3e?
Reply
#55

Quote:
Originally Posted by jaami
Посмотреть сообщение
Is there cop_tools for 0.3d or 0.3e?
It also works for d and e
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)