SA-MP Forums Archive
PlayerToPointcp Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PlayerToPointcp Problem (/showthread.php?tid=400694)



PlayerToPointcp Problem - Patrick - 19.12.2012

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;
}



Re: PlayerToPointcp Problem - [CG]Milito - 19.12.2012

Even if the player is cop?


Re: PlayerToPointcp Problem - Patrick - 19.12.2012

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


Re: PlayerToPointcp Problem - [CG]Milito - 19.12.2012

PlayerToPointCP? what? I don't know that function


Re: PlayerToPointcp Problem - Patrick - 19.12.2012

Nevermind Problem Fixed
Topic Closed!