Need help fast. +1 rep
#1

Hey how to i fix this problem. I wanna make so player have to write /onduty before they can use /lspdlocker


pawn Код:
CMD:lspdlocker(playerid, params[])
{
        if(PInfo[playerid][pCop] >= 2)
        if(PInfo[playerid][OnDuty] == 1) // your variable for logged players if(PInfo[playerid][Logged] == 1)
    {
        SendClientMessage(playerid,COLOR_GREY," You are not an OnDuty Officer, %s %s",copLevel(playerid),PlayerName(playerid));
        return 0;
    }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 254.0871,73.6980,1003.6406,181.3983))
        ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"LSPD LOCKER","Weapons\nSkins\nArmour/Pills", "OK","CANCEL");
      return 1;
}

CMD:onduty(playerid, params[])
{
if(PInfo[playerid][pCop] >= 2) {
SendClientMessage(playerid, COLOR_GREEN, "fuck siv");
PInfo[playerid][OnDuty] = 1;
        }
        else //if he has not got the permissions
        {
            SendClientMessage(playerid, COLOR_RED, "OMG are you stupid fuck siv"); //return this message
        }
return 1;
}
Reply
#2

pawn Код:
CMD:lspdlocker(playerid, params[])
{
        if(PInfo[playerid][pCop] >= 2)
        if(PInfo[playerid][OnDuty] == 0) // your variable for logged players if(PInfo[playerid][Logged] == 1)
    {
        SendClientMessage(playerid,COLOR_GREY," You are not an OnDuty Officer, %s %s",copLevel(playerid),PlayerName(playerid));
        return 0;
    }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 254.0871,73.6980,1003.6406,181.3983))
        ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"LSPD LOCKER","Weapons\nSkins\nArmour/Pills", "OK","CANCEL");
      return 1;
}
Basically, you sent error message if player was on-duty not off
Reply
#3

Код:
* * * * if(PInfo[playerid][OnDuty] == 0)// your variable for logged players if(PInfo[playerid][Logged] == 1)
Reply
#4

pawn Код:
CMD:lspdlocker(playerid, params[])
{
    new str[128];
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 254.0871,73.6980,1003.6406,181.3983))
    {
        if(PInfo[playerid][pCop] >= 2 && PInfo[playerid][OnDuty] == 1)
        {
            ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"LSPD LOCKER","Weapons\nSkins\nArmour/Pills", "OK","CANCEL");
            format(str, sizeof(string)," You are not an OnDuty Officer, %s %s",copLevel(playerid),PlayerName(playerid));
            SendClientMessage(playerid,COLOR_GREY,str);
        }
    }
    else
    {
        format(str, sizeof(string)," You are not an OnDuty Officer, %s %s",copLevel(playerid),PlayerName(playerid));
        SendClientMessage(playerid,COLOR_GREY,str);
        return 1;
    }
    return 1;
}
CMD:onduty(playerid, params[])
{
    if(PInfo[playerid][pCop] >= 2)
    {
        SendClientMessage(playerid, COLOR_GREEN, "fuck siv");
        PInfo[playerid][OnDuty] = 1;
    }
    else //if he has not got the permissions
    {
        SendClientMessage(playerid, COLOR_RED, "OMG are you stupid fuck siv"); //return this message
        return 1;
    }
    return 1;
}
Reply
#5

When i use the command /lspdlocker it crashing my server
Reply
#6

Post your "copLevel" on here too

pawn Код:
CMD:lspdlocker(playerid, params[])
{
    new str[128];
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 254.0871,73.6980,1003.6406,181.3983))
    {
        if(PInfo[playerid][pCop] >= 2 && PInfo[playerid][OnDuty] == 1)
        {
            ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"LSPD LOCKER","Weapons\nSkins\nArmour\nPills", "OK","CANCEL");
            format(str, sizeof(string)," You are on OnDuty Officer, %d %s",copLevel(playerid),PlayerName(playerid));
            SendClientMessage(playerid,COLOR_GREY,str);
        }
    }
    else
    {
        format(str, sizeof(string)," You are not an OnDuty Officer, %d %s",copLevel(playerid),PlayerName(playerid));
        SendClientMessage(playerid,COLOR_GREY,str);
        return 1;
    }
    return 1;
}
CMD:onduty(playerid, params[])
{
    if(PInfo[playerid][pCop] >= 2)
    {
        SendClientMessage(playerid, COLOR_GREEN, "fuck siv");
        PInfo[playerid][OnDuty] = 1;
    }
    else //if he has not got the permissions
    {
        SendClientMessage(playerid, COLOR_RED, "OMG are you stupid fuck siv"); //return this message
        return 1;
    }
    return 1;
}
Reply
#7

It still crashing when i type /lspdlocker?
Reply
#8

pawn Код:
stock copLevel(playerid)
{
   new svString[120];

   switch (PInfo[playerid][pCop])
   {
       case 1: svString = "Trainee";
       case 2: svString = "Cadet";
       case 3: svString = "Police Officer I";
       case 4: svString = "Police Officer II";
       case 5: svString = "Police Officer III";
       case 6: svString = "Senior Lead Officer";
       case 7: svString = "Detective I";
       case 8: svString = "Detective II";
       case 9: svString = "Sergeant I";
       case 10: svString = "Sergeant II";
       case 11: svString = "Lieutenant";
       case 12: svString = "Captain";
       case 13: svString = "Commander";
       case 14: svString = "Deputy Chief";
       case 15: svString = "Chief of Police";
   }
   return svString;
}
Reply
#9

pawn Код:
CMD:lspdlocker(playerid, params[])
{
    new str[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 254.0871,73.6980,1003.6406))
    {
        if(PInfo[playerid][pCop] >= 2 && PInfo[playerid][OnDuty] == 1)
        {
            ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"LSPD LOCKER","Weapons\nSkins\nArmour\nPills", "OK","CANCEL");
            format(str, sizeof(str), "You are on duty as %s - %s.", copLevel(playerid), name));
            SendClientMessage(playerid,COLOR_GREY,str);
        }
    }
    else
    {
        format(str, sizeof(str), "You are on duty as %s - %s.", copLevel(playerid), name));
        SendClientMessage(playerid,COLOR_GREY,str);
        return 1;
    }
    return 1;
}
CMD:onduty(playerid, params[])
{
    if(PInfo[playerid][pCop] >= 2)
    {
        SendClientMessage(playerid, COLOR_GREEN, "fuck siv");
        PInfo[playerid][OnDuty] = 1;
    }
    else //if he has not got the permissions
    {
        SendClientMessage(playerid, COLOR_RED, "OMG are you stupid fuck siv"); //return this message
        return 1;
    }
    return 1;
}
Reply
#10

Thanks man, One thing more. How can i do so when a cop type /onduty his colour will change to this id: 0x0080FFFF
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)