19.12.2012, 20:42
hello guys i am having problem using PlayerToPointcp i made a command /robcasino but anyone can still rob it even they are not inside/near casino can anyone help me they can only rob when they are at this X,Y,Z
My full command /robcasino
Код:
253.9280,69.6094,1003.6406
pawn Код:
dcmd_robcasino(playerid,params[])
{
#pragma unused params
new string[128];
new pname[24];
if(PlayerToPointcp(10, playerid, 253.9280,69.6094,1003.6406))
{
//Do Nothing
return 1;
}
if(IsCuffed[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot rob Casino while cuffed, how could you manage that?");
return 1;
}
if(IsFrozen[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot rob Casino while frozen by an administrator, how could you manage that?");
return 1;
}
if(gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_MEDIC)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot rob things with your class/skill.");
return 1;
}
if(CasinoRobbedRecently >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"Casino has been robbed recently. Please wait before robbing it again.");
return 1;
}
CasinoRobbedRecently =300;
RobbingCasino[playerid] =25;
IncreaseWantedLevel(playerid,4);
IncreasePlayerScore(playerid,1);
GetPlayerName(playerid,pname,sizeof(pname));
format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has begun to rob Casino! Get To Supa Save and arrest the suspect.",pname,playerid);
SendClientMessageToAllCops(string);
format(string,sizeof(string),"[ROBBERY] %s(%d) has begun a robbery at Casino ..",pname,playerid);
SendClientMessageToAll(COLOR_RED,string);
format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at Casino ..",pname,playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}