SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 28/12/2011, 06:31 AM   #1
$$Money$$
Big Clucker
 
$$Money$$'s Avatar
 
Join Date: May 2011
Posts: 71
Reputation: 0
Default How can i fix this?

pawn Code:
if(strcmp(cmd, "/fine", true) == 0) // By CuervO_NegrO
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /fine [playerid/PartOfName] [money] <reason>");
                return 1;
            }
            new playa;
            new money;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            money = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 2)
            {
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));

                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[128];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SafeGivePlayerMoney(playa, - money);
                            format(string, 256, "[ADMIN]: %s (%d) has been fined $%d by %s [No Reason Given].", giveplayer, playa,money, sendername);
                            SendAdminMessage(COLOR_LIGHTRED,string);
                            format(string, sizeof(string), "You have Fined $%d to %s (%d), No Reason Given.",money, giveplayer, playa);
                            SendClientMessage(playerid,COLOR_LIGHTRED ,string);
                            format(string, sizeof(string), "%s (%d), Has Been Fined $%d by %s, No Reason Given", giveplayer, playa, money, sendername);
                            SendClientMessageToAll(COLOR_NICERED, string);
                            format(string, sizeof(string), "~r~~h~-Admin Fined- ~n~~n~~n~~n~~n~~n~~n~~y~No reason Given ~n~Money: ~g~$%d", money);
                            GameTextForPlayer(playa, string, 7000, 3);
                            new y, m, d;
                            new h,mi,s;
                            getdate(y,m,d);
                            gettime(h,mi,s);
                            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has been fined by %s | Reason: None | Money: $%d |.",d,m,y,h,mi,s,giveplayer,sendername, money);
                            PayLog(string);
                            AdminLog(string);
                            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Fined by %s - Reason: None - Money: $%d .",d,m,y,h,mi,s,sendername,money);
                            AddPunishment(playa, string);
                            return 1;
                        }
                        SafeGivePlayerMoney(playa, - money);
                        format(string, 256, "[ADMIN]: %s (%d) has been fined $%d by %s [Reason: %s].", giveplayer, playa,money, sendername, (result));
                        SendAdminMessage(COLOR_LIGHTRED,string);
                        format(string, sizeof(string), "You have Fined $%d to %s (%d) for: %s .",money, giveplayer, playa, (result));
                        SendClientMessage(playerid,COLOR_LIGHTRED ,string);
                        format(string, sizeof(string), "%s (%d), Has Been Fined $%d by %s for: %s", giveplayer, playa, money, sendername, (result));
                        SendClientMessageToAll(COLOR_NICERED, string);
                        format(string, sizeof(string), "~r~~h~-Admin Fined- ~n~~n~~n~~n~~n~~n~~n~~y~Reason: ~w~%s ~n~Money: ~g~$%d",(result), money);
                        GameTextForPlayer(playa, string, 7000, 3);
                        new y, m, d;
                        new h,mi,s;
                        getdate(y,m,d);
                        gettime(h,mi,s);
                        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has been fined by %s | Reason: %s | Money: $%d |.",d,m,y,h,mi,s,giveplayer,sendername,(result),money);
                        PayLog(string);
                        AdminLog(string);
                        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Fined by %s - Reason: %s - Money: $%d.",d,m,y,h,mi,s,sendername,(result),money);
                        AddPunishment(playa, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
            }
        }
        return 1;
    }
                    if(UseAdmCmdTimer[playerid] > 3)
                    {
                        new IP[16];
                        new year, month, day;
                        getdate(year, month, day);
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerIp(playerid, IP, sizeof(IP));
                        format(string, sizeof(string), "%s [%d/%d/%d] Name: %s Key: %s Reason: Spam.", IP, day, month, year,sendername,PlayerInfo[playerid][pKey]);
                        BanLog(string);
                        format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s was banned, reason: Spam.", sendername);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        PlayerInfo[playerid][pBand] = 3;
                        PlayerInfo[playerid][pPermBand] = 1;
                        BanEx(playerid, "Banned By: Autoban Reason: Spam");

                        return 1;
                    }
                    PlayerInfo[giveplayerid][pCash] = PlayerInfo[giveplayerid][pCash]-moneys;
                    GivePlayerMoney(giveplayerid,-moneys);
                    format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s has been fined $%d by an Admin, reason: %s", giveplayer, moneys, (result));
                    SendClientMessageToAll(COLOR_LIGHTRED, string);
                    UseAdmCmdTimer[playerid]++;
                    SetTimerEx("UseAdmCmd",3*1000,0,"i",playerid); //3 seconds
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   That player is Offline !");
                return 1;
            }
        }
        return 1;
    }

I have try the command i was admin level 99999 and it say unauthorized to use that command!/fine
__________________
Looking for a scripter for FREE!!
Contact me msn:arnoldaztecas@hotmail.com
yahoo:truerealityroleplay@yahoo.com
skype:$$Money$$
If i got money from server donater, will pay you by alertpay,paypal or volt-host.
Mapper and Scripter.You will get co-owner status for the server
and I will buy the host and helping you get some ideas and
scripts.Hope you will helped me!Pm me or contact me.
$$Money$$ is offline   Reply With Quote
Old 28/12/2011, 06:33 AM   #2
Abreezy
Gangsta
 
Abreezy's Avatar
 
Join Date: Jan 2011
Location: Bronx
Posts: 560
Reputation: 42
Default Re: How can i fix this?

If you are admin Level 99999, which is overkilll considering raven's highest is what, 1338? It should work anyways. Try to set your admin level to something normal..
__________________

(Click the image for link to gamemode release)
| Completely dynamic gamemode, made completely from scratch, MySQL |
| Will script for cash, just send me a PM with information on what you want. |
Abreezy is offline   Reply With Quote
Old 28/12/2011, 06:40 AM   #3
$$Money$$
Big Clucker
 
$$Money$$'s Avatar
 
Join Date: May 2011
Posts: 71
Reputation: 0
Default Re: How can i fix this?

sorry,,not that this
pawn Code:
if(strcmp(cmd, "/fine", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] <= 3 || PlayerInfo[playerid][pHelper] <= 4)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
                return 1;
            }
            moneys = strvalEx(tmp);
            if(moneys < 1) { SendClientMessage(playerid, COLOR_GREY, "   Fine Money can't be below 1 !"); return 1; }
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    new length = strlen(cmdtext);
                    while ((idx < length) && (cmdtext[idx] <= ' '))
                    {
                        idx++;
                    }
                    new offset = idx;
                    new result[64];
                    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                    {
                        result[idx - offset] = cmdtext[idx];
                        idx++;
                    }
                    result[idx - offset] = EOS;
                    if(!strlen(result))
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
                        return 1;
                    }
                    if(UseAdmCmdTimer[playerid] > 3)
                    {
                        new IP[16];
                        new year, month, day;
                        getdate(year, month, day);
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerIp(playerid, IP, sizeof(IP));
                        format(string, sizeof(string), "%s [%d/%d/%d] Name: %s Key: %s Reason: Spam.", IP, day, month, year,sendername,PlayerInfo[playerid][pKey]);
                        BanLog(string);
                        format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s was banned, reason: Spam.", sendername);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        PlayerInfo[playerid][pBand] = 3;
                        PlayerInfo[playerid][pPermBand] = 1;
                        BanEx(playerid, "Banned By: Autoban Reason: Spam");
                       
                        return 1;
                    }
                    PlayerInfo[giveplayerid][pCash] = PlayerInfo[giveplayerid][pCash]-moneys;
                    GivePlayerMoney(giveplayerid,-moneys);
                    format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s has been fined $%d by an Admin, reason: %s", giveplayer, moneys, (result));
                    SendClientMessageToAll(COLOR_LIGHTRED, string);
                    UseAdmCmdTimer[playerid]++;
                    SetTimerEx("UseAdmCmd",3*1000,0,"i",playerid); //3 seconds
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   That player is Offline !");
                return 1;
            }
        }
        return 1;
    }
__________________
Looking for a scripter for FREE!!
Contact me msn:arnoldaztecas@hotmail.com
yahoo:truerealityroleplay@yahoo.com
skype:$$Money$$
If i got money from server donater, will pay you by alertpay,paypal or volt-host.
Mapper and Scripter.You will get co-owner status for the server
and I will buy the host and helping you get some ideas and
scripts.Hope you will helped me!Pm me or contact me.
$$Money$$ is offline   Reply With Quote
Old 28/12/2011, 06:46 AM   #4
$$Money$$
Big Clucker
 
$$Money$$'s Avatar
 
Join Date: May 2011
Posts: 71
Reputation: 0
Default Re: How can i fix this?

Help me please?
__________________
Looking for a scripter for FREE!!
Contact me msn:arnoldaztecas@hotmail.com
yahoo:truerealityroleplay@yahoo.com
skype:$$Money$$
If i got money from server donater, will pay you by alertpay,paypal or volt-host.
Mapper and Scripter.You will get co-owner status for the server
and I will buy the host and helping you get some ideas and
scripts.Hope you will helped me!Pm me or contact me.
$$Money$$ is offline   Reply With Quote
Old 28/12/2011, 06:49 AM   #5
$$Money$$
Big Clucker
 
$$Money$$'s Avatar
 
Join Date: May 2011
Posts: 71
Reputation: 0
Default Re: How can i fix this?

Any help?
__________________
Looking for a scripter for FREE!!
Contact me msn:arnoldaztecas@hotmail.com
yahoo:truerealityroleplay@yahoo.com
skype:$$Money$$
If i got money from server donater, will pay you by alertpay,paypal or volt-host.
Mapper and Scripter.You will get co-owner status for the server
and I will buy the host and helping you get some ideas and
scripts.Hope you will helped me!Pm me or contact me.
$$Money$$ is offline   Reply With Quote
Old 28/12/2011, 07:37 AM   #6
jamesbond007
Gangsta
 
jamesbond007's Avatar
 
Join Date: Oct 2009
Location: Canadia
Posts: 790
Reputation: 50
Default Re: How can i fix this?

lol wtf? use zcmd or at least dcmd dude... its much simpler and easier..
jamesbond007 is offline   Reply With Quote
Old 28/12/2011, 07:39 AM   #7
jamesbond007
Gangsta
 
jamesbond007's Avatar
 
Join Date: Oct 2009
Location: Canadia
Posts: 790
Reputation: 50
Default Re: How can i fix this?

try this dude
pawn Code:
if(strcmp(cmd, "/fine", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[playerid][pHelper] <= 4)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
                return 1;
            }
            moneys = strvalEx(tmp);
            if(moneys < 1) { SendClientMessage(playerid, COLOR_GREY, "   Fine Money can't be below 1 !"); return 1; }
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    new length = strlen(cmdtext);
                    while ((idx < length) && (cmdtext[idx] <= ' '))
                    {
                        idx++;
                    }
                    new offset = idx;
                    new result[64];
                    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                    {
                        result[idx - offset] = cmdtext[idx];
                        idx++;
                    }
                    result[idx - offset] = EOS;
                    if(!strlen(result))
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fine [playerid/PartOfName] [price] [reason]");
                        return 1;
                    }
                    if(UseAdmCmdTimer[playerid] > 3)
                    {
                        new IP[16];
                        new year, month, day;
                        getdate(year, month, day);
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        GetPlayerIp(playerid, IP, sizeof(IP));
                        format(string, sizeof(string), "%s [%d/%d/%d] Name: %s Key: %s Reason: Spam.", IP, day, month, year,sendername,PlayerInfo[playerid][pKey]);
                        BanLog(string);
                        format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s was banned, reason: Spam.", sendername);
                        SendClientMessageToAll(COLOR_LIGHTRED, string);
                        PlayerInfo[playerid][pBand] = 3;
                        PlayerInfo[playerid][pPermBand] = 1;
                        BanEx(playerid, "Banned By: Autoban Reason: Spam");
                       
                        return 1;
                    }
                    PlayerInfo[giveplayerid][pCash] = PlayerInfo[giveplayerid][pCash]-moneys;
                    GivePlayerMoney(giveplayerid,-moneys);
                    format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s has been fined $%d by an Admin, reason: %s", giveplayer, moneys, (result));
                    SendClientMessageToAll(COLOR_LIGHTRED, string);
                    UseAdmCmdTimer[playerid]++;
                    SetTimerEx("UseAdmCmd",3*1000,0,"i",playerid); //3 seconds
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   That player is Offline !");
                return 1;
            }
        }
        return 1;
    }
jamesbond007 is offline   Reply With Quote
Old 28/12/2011, 09:41 PM   #8
jamesbond007
Gangsta
 
jamesbond007's Avatar
 
Join Date: Oct 2009
Location: Canadia
Posts: 790
Reputation: 50
Default Re: How can i fix this?

did it work ?? what i gave u ? why are you making multiple threads?
jamesbond007 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 10:36 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.