20.01.2013, 00:39
I want to make all casino's robbing command /robcasino, but it dont work for all
How to fix ?
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;
}