just small code/fix
#1

!-Solved-!

Note : the problem with /aSLAP cmd not /aduty
Код:
[09:46:06] ServerOwner says: hello samp forums [09:46:09] ServerOwner says: i wanna know what wrong with this commands please [09:46:17] USAGE: /aslap [player] [09:46:25] ServerOwner says: *** iam off duty now *** [09:46:26] You have clocked out from Admin Duty, you are now in Role Play Mode. [09:46:33] You can't do this whilst your off Duty! [09:47:02] ServerOwner says: still working and getting you are off duty why ? [09:47:20] ServerOwner says: thanks for reading the post
Image :


Code :
aSLAP CMD
pawn Код:
CMD:aslap(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >=2)
    {
        if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdminDuty] != 1)
        {
            SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!");
        }
        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /aslap [player]");

        new Float:shealth;
        new Float:slx, Float:sly, Float:slz;

        if(IsPlayerConnected(giveplayerid))
        {

            GetPlayerHealth(giveplayerid, shealth);
            SetPlayerHealth(giveplayerid, shealth-5);
            GetPlayerPos(giveplayerid, slx, sly, slz);
            SetPlayerPos(giveplayerid, slx, sly, slz+5);
            PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
            format(string, sizeof(string), "AdmCmd: %s was slapped by %s",GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
            ABroadCast(COLOR_LIGHTRED,string,2);

        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
    }
    return 1;
}
aDUTY CMD
pawn Код:
CMD:aduty(playerid, params[]) {
    new string[128];
    if((PlayerInfo[playerid][pAdmin] >= 2) && GetPVarInt(playerid, "IsInArena") < 0 && !GetPVarInt(playerid, "EventToken")) {
        if(PlayerInfo[playerid][pAdminDuty]) {
            PlayerInfo[playerid][pAdminDuty] = 0;
            PlayerInfo[playerid][pTogReports] = 1;
            //SetPlayerToTeamColor(playerid);
            SendClientMessageEx(playerid, COLOR_WHITE, "You have clocked out from Admin Duty, you are now in Role Play Mode.");
            format(string, sizeof(string), "{AA3333}Admin Duty{FFFF00}: %s has clocked off and is now off duty.", GetPlayerNameEx(playerid));
            ABroadCast(COLOR_YELLOW,string, 2);
        }
        else {
            PlayerInfo[playerid][pAdminDuty] = 1;
            PlayerInfo[playerid][pTogReports] = 0;
            //SetPlayerToTeamColor(playerid);
            SendClientMessageEx(playerid, COLOR_WHITE, "You have clocked in to Admin Duty, you are no longer in Role play Mode.");
            format(string, sizeof(string), "{AA3333}Admin Duty{FFFF00}: %s has clocked in and is now on duty.", GetPlayerNameEx(playerid));
            ABroadCast(COLOR_YELLOW,string, 2);
        }
    }
    return 1;
}
Reply
#2

pawn Код:
#define CMDLEVEL(%0) if(PlayerInfo[playerid][pAdmin] < %0) SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");

CMD:aslap(playerid, params[])
{
    CMDLEVEL(2);

    if(!PlayerInfo[playerid][pAdminDuty]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!");

    new giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /aslap [player]");

    if(IsPlayerConnected(giveplayerid))
    {
        new string[128], Float:shealth, Float:slx, Float:sly, Float:slz;
        GetPlayerHealth(giveplayerid, shealth);
        SetPlayerHealth(giveplayerid, shealth-5);
        GetPlayerPos(giveplayerid, slx, sly, slz);
        SetPlayerPos(giveplayerid, slx, sly, slz+5);
        PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
        format(string, sizeof(string), "AdmCmd: %s was slapped by %s",GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
        ABroadCast(COLOR_LIGHTRED,string,2);
    }
    return 1;
}
Reply
#3

hmm there is a define in the script for admin level thats not the problem that problem is its still working while offduty my code must stop at " you cant do that while off duty " understand me ?

also another thing how to make cutter rims ? here is my gold rims
pawn Код:
CMD:goldrims(playerid, params[])
{
    if(IsPlayerConnected(playerid)) {
        if(PlayerInfo[playerid][pAdmin] < 2) {
            SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
            return 1;
        }
        if(!IsPlayerInAnyVehicle(playerid)) {
            return SendClientMessageEx(playerid, COLOR_GRAD2, "You must be in a car to add Gold Rims.");
        }
        if(IsPlayerInAnyVehicle(playerid)) {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
            SendClientMessageEx(playerid, COLOR_WHITE, "Gold Rims Added to Vehicle!");
        }
    }
    return 1;
}
Reply
#4

Check my update again.

pawn Код:
#define     CUTTER_RIMS     1079
#define     GOLD_RIMS       1080

CMD:cutterrims(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    AddRims(playerid, CUTTER_RIMS, "Cutter Rims");
    return 1;
}


CMD:goldrims(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    AddRims(playerid, GOLD_RIMS, "Gold Rims");
    return 1;
}

stock AddRims(playerid, type, name[])
{
    if(!IsPlayerInAnyVehicle(playerid))
    {
        new line[128];
        format(line, sizeof(line), "You must be in a car to add %s.", name);
        return SendClientMessageEx(playerid, line);
    }
    else
    {
        new line[128];
        AddVehicleComponent(GetPlayerVehicleID(playerid), type);
        format(line, sizeof(line), "%s Added To Vehicle!", name);
        SendClientMessageEx(playerid, COLOR_WHITE, line);
    }
    return 1;
}
Reply
#5

hmm ok ill try this line to my code and i will tell you my reply

pawn Код:
if(!PlayerInfo[playerid][pAdminDuty]) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!");

or

if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdminDuty] != 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!");
Код:
do you know how to make the Cutter rims ?
Reply
#6

You have given out too much Reputation in the last 24 hours, try again later.

Sorry Cant Rep+


Код:
[10:15:42] Cool Working says: Wow [10:15:46] Cool Working says: thanks man its working [10:15:51] You can't do this whilst your off Duty! [10:15:57] You have clocked in to Admin Duty, you are no longer in Role play Mode. [10:15:57] {AA3333}Admin Duty{FFFF00}: Cool Working has clocked in and is now on duty. [10:15:59] AdmCmd: Cool Working was slapped by Cool Working [10:16:08] Cool Working says: :) Rep+ed
image :

Code:
pawn Код:
CMD:aslap(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >=2)
    {
        if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdminDuty] != 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!");
       
        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /aslap [player]");

        new Float:shealth;
        new Float:slx, Float:sly, Float:slz;

        if(IsPlayerConnected(giveplayerid))
        {

            GetPlayerHealth(giveplayerid, shealth);
            SetPlayerHealth(giveplayerid, shealth-5);
            GetPlayerPos(giveplayerid, slx, sly, slz);
            SetPlayerPos(giveplayerid, slx, sly, slz+5);
            PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
            format(string, sizeof(string), "AdmCmd: %s was slapped by %s",GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid));
            ABroadCast(COLOR_LIGHTRED,string,2);

        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)