PlayerToPointcp Problem
#1

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
Код:
253.9280,69.6094,1003.6406
My full command /robcasino
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;
}
Reply
#2

Even if the player is cop?
Reply
#3

Quote:
Originally Posted by [CG]Milito
Посмотреть сообщение
Even if the player is cop?
ofcourse no. did you see the thing that cops cant rob it? the problem only is the civilian people.... even when they are not at the Position they can still rob it even they are outside
Reply
#4

PlayerToPointCP? what? I don't know that function
Reply
#5

Nevermind Problem Fixed
Topic Closed!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)