#1

I want to make all casino's robbing command /robcasino, but it dont work for all

pawn Код:
C:\Program Files\Files2\SA-MP Servers\Cops And Robbers [ORGINAL SERVER]\gamemodes\LVCNR.pwn(20902) : error 021: symbol already defined: "cmd_robcasino"
C:\Program Files\Files2\SA-MP Servers\Cops And Robbers [ORGINAL SERVER]\gamemodes\LVCNR.pwn(20922) : error 021: symbol already defined: "cmd_robcasino"

How to fix ?


pawn Код:
CMD:robcasino(playerid, params[])
{
    if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
    if(IsRobbingRedsands{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
    if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
    if((gettime() - 120) < TimerInfo[playerid][CMD_timer18]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
    TimerInfo[playerid][CMD_timer18] = gettime();
    new chance = random(3);
    if(chance == 0)
    {
        format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the Redsands Casino at Redsands West.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, RED, "You have failed to rob the Redsands Casino.");
        GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
    }
    else if(GetPlayerVirtualWorld(playerid) == 3 && IsPlayerInRangeOfPoint(playerid,1.0,1139.7198,-4.0644,1000.6719))
    {
        if((gettime() - 120) < redrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
        format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing the Redsands Casino at Redsands West.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, LIGHTGREEN, "Your robbing the Redsands Casino, DON'T LEAVE THE CHECKPOINT!");
        GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
        IsRobbingRedsands{playerid} = true;
        SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
        redsandstimer{playerid} = SetTimerEx("RedsandsRob", 25000, false, "d", playerid);
        ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
        redrobbed = gettime();
    }
    else
    {
        SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
    }
    new astring[100],pName[24];
    GetPlayerName(playerid,(pName),sizeof(pName));
    format(astring,sizeof(astring),"%s [%d] typed: /robred",pName,playerid);
    SendAdminMessage(GREY,astring);
    return true;
}

CMD:robcasino(playerid, params[])
{
    if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
    if(IsRobbingCalg{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
    if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
    if((gettime() - 120) < TimerInfo[playerid][CMD_timer19]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
    TimerInfo[playerid][CMD_timer19] = gettime();
    new chance = random(3);
    if(chance == 0)
    {
        format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the Caligulas Casino at The New Vegas Strip.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, RED, "You have failed to rob the Caligulas Casino.");
        GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
    }
    else if(IsPlayerInRangeOfPoint(playerid,1.0,2156.6917,1599.5377,1006.1797))
    {
        if((gettime() - 120) < calgrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
        format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing Caligulas Casino at The New Vegas Strip.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, LIGHTGREEN, "Your robbing Caligulas Casino, DON'T LEAVE THE CHECKPOINT!");
        GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
        SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
        IsRobbingCalg{playerid} = true;
        calgtimer{playerid} = SetTimerEx("CalgRob", 25000, false, "d", playerid);
        ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
        calgrobbed = gettime();
    }
    else
    {
        SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
    }
    new astring[100],pName[24];
    GetPlayerName(playerid,(pName),sizeof(pName));
    format(astring,sizeof(astring),"%s [%d] typed: /robcalg",pName,playerid);
    SendAdminMessage(GREY,astring);
    return true;
}
Reply
#2

Already defined somewhere in script! Somewhere is the same command...
Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 66 seconds. (I hate it)
Reply
#3

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
Already defined somewhere in script! Somewhere is the same command...
I know, in server got 4 casinos! For all i want command /robcasino
Reply
#4

You can just make 1 cmd with 4 locations not just 4 example cmds.... So make one for all 4 robcasinos!
Reply
#5

How From This I can make in 1 CMD

pawn Код:
CMD:robvegas(playerid, params[])
{
    if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
    if(IsRobbingVegas{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
    if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
    if((gettime() - 120) < TimerInfo[playerid][CMD_timer17]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
    TimerInfo[playerid][CMD_timer17] = gettime();
    new chance = random(3);
    if(chance == 0)
    {
        format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the New Vegas Casino at The New Vegas Strip.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, RED, "You have failed to rob the New Vegas Casino.");
        GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
    }
    else if(GetPlayerVirtualWorld(playerid) == 2 && IsPlayerInRangeOfPoint(playerid,1.0,1139.7198,-4.0644,1000.6719))
    {
        if((gettime() - 120) < vegasrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
        format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing the New Vegas Casino at The New Vegas Strip.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, LIGHTGREEN, "Your robbing the New Vegas Casino, DON'T LEAVE THE CHECKPOINT!");
        GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
        SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
        IsRobbingVegas{playerid} = true;
        vegastimer{playerid} = SetTimerEx("VegasRob", 25000, false, "d", playerid);
        ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
        vegasrobbed = gettime();
    }
    else
    {
        SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
    }
    new astring[100],pName[24];
    GetPlayerName(playerid,(pName),sizeof(pName));
    format(astring,sizeof(astring),"%s [%d] typed: /robvegas",pName,playerid);
    SendAdminMessage(GREY,astring);
    return true;
}

CMD:robred(playerid, params[])
{
    if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
    if(IsRobbingRedsands{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
    if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
    if((gettime() - 120) < TimerInfo[playerid][CMD_timer18]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
    TimerInfo[playerid][CMD_timer18] = gettime();
    new chance = random(3);
    if(chance == 0)
    {
        format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the Redsands Casino at Redsands West.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, RED, "You have failed to rob the Redsands Casino.");
        GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
    }
    else if(GetPlayerVirtualWorld(playerid) == 3 && IsPlayerInRangeOfPoint(playerid,1.0,1139.7198,-4.0644,1000.6719))
    {
        if((gettime() - 120) < redrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
        format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing the Redsands Casino at Redsands West.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, LIGHTGREEN, "Your robbing the Redsands Casino, DON'T LEAVE THE CHECKPOINT!");
        GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
        IsRobbingRedsands{playerid} = true;
        SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
        redsandstimer{playerid} = SetTimerEx("RedsandsRob", 25000, false, "d", playerid);
        ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
        redrobbed = gettime();
    }
    else
    {
        SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
    }
    new astring[100],pName[24];
    GetPlayerName(playerid,(pName),sizeof(pName));
    format(astring,sizeof(astring),"%s [%d] typed: /robred",pName,playerid);
    SendAdminMessage(GREY,astring);
    return true;
}

CMD:robcalg(playerid, params[])
{
    if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
    if(IsRobbingCalg{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
    if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
    if((gettime() - 120) < TimerInfo[playerid][CMD_timer19]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
    TimerInfo[playerid][CMD_timer19] = gettime();
    new chance = random(3);
    if(chance == 0)
    {
        format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the Caligulas Casino at The New Vegas Strip.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, RED, "You have failed to rob the Caligulas Casino.");
        GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
    }
    else if(IsPlayerInRangeOfPoint(playerid,1.0,2156.6917,1599.5377,1006.1797))
    {
        if((gettime() - 120) < calgrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
        format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing Caligulas Casino at The New Vegas Strip.", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, LIGHTGREEN, "Your robbing Caligulas Casino, DON'T LEAVE THE CHECKPOINT!");
        GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
        SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
        IsRobbingCalg{playerid} = true;
        calgtimer{playerid} = SetTimerEx("CalgRob", 25000, false, "d", playerid);
        ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
        calgrobbed = gettime();
    }
    else
    {
        SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
    }
    new astring[100],pName[24];
    GetPlayerName(playerid,(pName),sizeof(pName));
    format(astring,sizeof(astring),"%s [%d] typed: /robcalg",pName,playerid);
    SendAdminMessage(GREY,astring);
    return true;
}

CMD:robdrag(playerid, params[])
{
    if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
    if(IsRobbingDrag{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
    if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
    if((gettime() - 120) < TimerInfo[playerid][CMD_timer20]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
    TimerInfo[playerid][CMD_timer20] = gettime();
    new chance = random(3);
    if(chance == 0)
    {
        format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, RED, "You have failed to rob the 4 Dragons Casino.");
        GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
    }
    else if(IsPlayerInRangeOfPoint(playerid,1.0,1955.3691,1018.0455,992.4688))
    {
        if((gettime() - 120) < dragrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
        format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, LIGHTGREEN, "Your robbing 4 Dragons Casino, DON'T LEAVE THE CHECKPOINT!");
        GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
        SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
        IsRobbingDrag{playerid} = true;
        dragtimer{playerid} = SetTimerEx("DragRob", 25000, false, "d", playerid);
        ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
        dragrobbed = gettime();
    }
    else
    {
        SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
    }
    new astring[100],pName[24];
    GetPlayerName(playerid,(pName),sizeof(pName));
    format(astring,sizeof(astring),"%s [%d] typed: /robdrag",pName,playerid);
    SendAdminMessage(GREY,astring);
    return true;
}
Reply
#6

You see you have CMD:robcasino(this command multiple time in your script thats why it showing that its already defined! You can change it with CMD:rocasinoa and CMD:robcasinob
Reply
#7

You can make it by checking what interior the player is in. If you're using checkpoints, you could check what checkpoint the player is in.
Reply
#8

Quote:
Originally Posted by BodyBoardVEVO
Посмотреть сообщение
How From This I can make in 1 CMD
Try this
pawn Код:
CMD:rob(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid,1.0,1139.7198,-4.0644,1000.6719) && GetPlayerVirtualWorld(playerid) == 2)
    {
        if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
        if(IsRobbingVegas{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
        if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
        if((gettime() - 120) < TimerInfo[playerid][CMD_timer17]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
        TimerInfo[playerid][CMD_timer17] = gettime();
        new chance = random(3);
        if(chance == 0)
        {
            format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the New Vegas Casino at The New Vegas Strip.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, RED, "You have failed to rob the New Vegas Casino.");
            GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
        }
        {
            if((gettime() - 120) < vegasrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
            format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing the New Vegas Casino at The New Vegas Strip.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, LIGHTGREEN, "Your robbing the New Vegas Casino, DON'T LEAVE THE CHECKPOINT!");
            GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
            SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
            IsRobbingVegas{playerid} = true;
            vegastimer{playerid} = SetTimerEx("VegasRob", 25000, false, "d", playerid);
            ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
            vegasrobbed = gettime();
        }
        else
        {
            SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
        }
            new astring[100],pName[24];
            GetPlayerName(playerid,(pName),sizeof(pName));
            format(astring,sizeof(astring),"%s [%d] typed: /rob",pName,playerid);
            SendAdminMessage(GREY,astring);
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid,1.0,1139.7198,-4.0644,1000.6719) && GetPlayerVirtualWorld(playerid) == 3)
    {
        if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
        if(IsRobbingRedsands{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
        if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
        if((gettime() - 120) < TimerInfo[playerid][CMD_timer18]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
        TimerInfo[playerid][CMD_timer18] = gettime();
        new chance = random(3);
        if(chance == 0)
        {
            format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the Redsands Casino at Redsands West.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, RED, "You have failed to rob the Redsands Casino.");
            GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
        }
        {
            if((gettime() - 120) < redrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
            format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing the Redsands Casino at Redsands West.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, LIGHTGREEN, "Your robbing the Redsands Casino, DON'T LEAVE THE CHECKPOINT!");
            GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
            IsRobbingRedsands{playerid} = true;
            SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
            redsandstimer{playerid} = SetTimerEx("RedsandsRob", 25000, false, "d", playerid);
            ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
            redrobbed = gettime();
        }
        else
        {
            SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
        }
        new astring[100],pName[24];
        GetPlayerName(playerid,(pName),sizeof(pName));
        format(astring,sizeof(astring),"%s [%d] typed: /rob",pName,playerid);
        SendAdminMessage(GREY,astring);
    }
    else if(IsPlayerInRangeOfPoint(playerid,1.0,2156.6917,1599.5377,1006.1797))
    {
        if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
        if(IsRobbingCalg{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
        if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
        if((gettime() - 120) < TimerInfo[playerid][CMD_timer19]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
        TimerInfo[playerid][CMD_timer19] = gettime();
        new chance = random(3);
        if(chance == 0)
        {
            format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the Caligulas Casino at The New Vegas Strip.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, RED, "You have failed to rob the Caligulas Casino.");
            GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
        }
        {
            if((gettime() - 120) < calgrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
            format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing Caligulas Casino at The New Vegas Strip.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, LIGHTGREEN, "Your robbing Caligulas Casino, DON'T LEAVE THE CHECKPOINT!");
            GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
            SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
            IsRobbingCalg{playerid} = true;
            calgtimer{playerid} = SetTimerEx("CalgRob", 25000, false, "d", playerid);
            ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
            calgrobbed = gettime();
        }
        else
        {
            SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
        }
        new astring[100],pName[24];
        GetPlayerName(playerid,(pName),sizeof(pName));
        format(astring,sizeof(astring),"%s [%d] typed: /rob",pName,playerid);
        SendAdminMessage(GREY,astring);
    }
    else if(IsPlayerInRangeOfPoint(playerid,1.0,1955.3691,1018.0455,992.4688))
    {
        if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
        if(IsRobbingDrag{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
        if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
        if((gettime() - 120) < TimerInfo[playerid][CMD_timer20]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
        TimerInfo[playerid][CMD_timer20] = gettime();
        new chance = random(3);
        if(chance == 0)
        {
            format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, RED, "You have failed to rob the 4 Dragons Casino.");
            GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
        }
        {
            if((gettime() - 120) < dragrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
            format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, LIGHTGREEN, "Your robbing 4 Dragons Casino, DON'T LEAVE THE CHECKPOINT!");
            GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
            SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
            IsRobbingDrag{playerid} = true;
            dragtimer{playerid} = SetTimerEx("DragRob", 25000, false, "d", playerid);
            ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
            dragrobbed = gettime();
        }
        else
        {
            SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
        }
        new astring[100],pName[24];
        GetPlayerName(playerid,(pName),sizeof(pName));
        format(astring,sizeof(astring),"%s [%d] typed: /rob",pName,playerid);
        SendAdminMessage(GREY,astring);
    }
    return true;
}
Reply
#9

Quote:
Originally Posted by Scott Zulkifli
Посмотреть сообщение
Try this
pawn Код:
CMD:rob(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid,1.0,1139.7198,-4.0644,1000.6719) && GetPlayerVirtualWorld(playerid) == 2)
    {
        if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
        if(IsRobbingVegas{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
        if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
        if((gettime() - 120) < TimerInfo[playerid][CMD_timer17]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
        TimerInfo[playerid][CMD_timer17] = gettime();
        new chance = random(3);
        if(chance == 0)
        {
            format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the New Vegas Casino at The New Vegas Strip.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, RED, "You have failed to rob the New Vegas Casino.");
            GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
        }
        {
            if((gettime() - 120) < vegasrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
            format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing the New Vegas Casino at The New Vegas Strip.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, LIGHTGREEN, "Your robbing the New Vegas Casino, DON'T LEAVE THE CHECKPOINT!");
            GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
            SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
            IsRobbingVegas{playerid} = true;
            vegastimer{playerid} = SetTimerEx("VegasRob", 25000, false, "d", playerid);
            ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
            vegasrobbed = gettime();
        }
        else
        {
            SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
        }
            new astring[100],pName[24];
            GetPlayerName(playerid,(pName),sizeof(pName));
            format(astring,sizeof(astring),"%s [%d] typed: /rob",pName,playerid);
            SendAdminMessage(GREY,astring);
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid,1.0,1139.7198,-4.0644,1000.6719) && GetPlayerVirtualWorld(playerid) == 3)
    {
        if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
        if(IsRobbingRedsands{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
        if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
        if((gettime() - 120) < TimerInfo[playerid][CMD_timer18]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
        TimerInfo[playerid][CMD_timer18] = gettime();
        new chance = random(3);
        if(chance == 0)
        {
            format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the Redsands Casino at Redsands West.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, RED, "You have failed to rob the Redsands Casino.");
            GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
        }
        {
            if((gettime() - 120) < redrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
            format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing the Redsands Casino at Redsands West.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, LIGHTGREEN, "Your robbing the Redsands Casino, DON'T LEAVE THE CHECKPOINT!");
            GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
            IsRobbingRedsands{playerid} = true;
            SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
            redsandstimer{playerid} = SetTimerEx("RedsandsRob", 25000, false, "d", playerid);
            ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
            redrobbed = gettime();
        }
        else
        {
            SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
        }
        new astring[100],pName[24];
        GetPlayerName(playerid,(pName),sizeof(pName));
        format(astring,sizeof(astring),"%s [%d] typed: /rob",pName,playerid);
        SendAdminMessage(GREY,astring);
    }
    else if(IsPlayerInRangeOfPoint(playerid,1.0,2156.6917,1599.5377,1006.1797))
    {
        if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
        if(IsRobbingCalg{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
        if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
        if((gettime() - 120) < TimerInfo[playerid][CMD_timer19]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
        TimerInfo[playerid][CMD_timer19] = gettime();
        new chance = random(3);
        if(chance == 0)
        {
            format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the Caligulas Casino at The New Vegas Strip.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, RED, "You have failed to rob the Caligulas Casino.");
            GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
        }
        {
            if((gettime() - 120) < calgrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
            format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing Caligulas Casino at The New Vegas Strip.", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, LIGHTGREEN, "Your robbing Caligulas Casino, DON'T LEAVE THE CHECKPOINT!");
            GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
            SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
            IsRobbingCalg{playerid} = true;
            calgtimer{playerid} = SetTimerEx("CalgRob", 25000, false, "d", playerid);
            ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
            calgrobbed = gettime();
        }
        else
        {
            SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
        }
        new astring[100],pName[24];
        GetPlayerName(playerid,(pName),sizeof(pName));
        format(astring,sizeof(astring),"%s [%d] typed: /rob",pName,playerid);
        SendAdminMessage(GREY,astring);
    }
    else if(IsPlayerInRangeOfPoint(playerid,1.0,1955.3691,1018.0455,992.4688))
    {
        if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
        if(IsRobbingDrag{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
        if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
        if((gettime() - 120) < TimerInfo[playerid][CMD_timer20]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
        TimerInfo[playerid][CMD_timer20] = gettime();
        new chance = random(3);
        if(chance == 0)
        {
            format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, RED, "You have failed to rob the 4 Dragons Casino.");
            GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 4);
        }
        {
            if((gettime() - 120) < dragrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
            format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
            CopRadio(BLUE, fstr);
            SendClientMessage(playerid, LIGHTGREEN, "Your robbing 4 Dragons Casino, DON'T LEAVE THE CHECKPOINT!");
            GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 25000, 5);
            SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
            IsRobbingDrag{playerid} = true;
            dragtimer{playerid} = SetTimerEx("DragRob", 25000, false, "d", playerid);
            ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
            dragrobbed = gettime();
        }
        else
        {
            SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
        }
        new astring[100],pName[24];
        GetPlayerName(playerid,(pName),sizeof(pName));
        format(astring,sizeof(astring),"%s [%d] typed: /rob",pName,playerid);
        SendAdminMessage(GREY,astring);
    }
    return true;
}
When i add this, my PAWN crashes
Reply
#10

try to check some } and {
maybe some is missing or you put too much brackers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)