SA-MP Forums Archive
Rob cmd tip - 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: Rob cmd tip (/showthread.php?tid=313742)



Rob cmd tip - Face9000 - 27.01.2012

Hello,i want use this /rob command ONLY if player is in a checkpoint:

pawn Код:
CMD:rob(playerid, params[])
{
    if(gTeam[playerid] == TEAM_COP) return SendClientMessage(playerid, red, "Cops can't do robberies!");
    if(IsSpawned[playerid] == 0) return SendClientMessage(playerid,0xFF0000FF,"You can't use this command when you are dead or spawning.");
    if(GetPVarInt(playerid,"RobTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"Please wait 60 seconds before rob again.");
    SetPVarInt(playerid,"RobTime",GetTickCount()+60000);
    pRobTimerID[playerid] = SetTimerEx("pRobTimer", 1000, true, "i", playerid);
    pRobCount[playerid] = 35;
    return true;
}
My Checkpoint:

pawn Код:
CPs[1] = CreateDynamicCP(70.6080,1873.4103,17.6406,3,0,0,-1,100);
Thank you.


Re: Rob cmd tip - MasterJoker - 27.01.2012

your using Incognito's streamer don't you?

well try this

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
     if(checkpointid == /* id of the checkpoint */)
     {
           //codes here
     }
     return 1;
}



Re: Rob cmd tip - Vince - 27.01.2012

pawn Код:
if(IsPlayerInDynamicCP(playerid, CPs[1])) { /* do stuff */ }



Re: Rob cmd tip - henry jiggy - 27.01.2012

He wants the command to be able to be executed only when the player is on the waypoint not automatically...

just leave your Checkpoint callbacks blank and use IsPlayerInRangeOfPoint with the range and coordinates of the checkpoint you created, on the command, as a checker.




Re: Rob cmd tip - Face9000 - 27.01.2012

Quote:
Originally Posted by henry jiggy
Посмотреть сообщение
He wants the command to be able to be executed only when the player is on the waypoint not automatically...

just leave your Checkpoint callbacks blank and use IsPlayerInRangeOfPoint with the range and coordinates of the checkpoint you created, on the command, as a checker.

Thanks,is what i needed.


Re: Rob cmd tip - henry jiggy - 27.01.2012

yay

The message you have entered is too short. Please lengthen your message to at least 4 characters.
This forum requires that you wait 120 seconds between posts. Please try again in 58 seconds.

FFFFFFFUUUUUUUUUUUUUUUUUUUUU---------

This forum requires that you wait 120 seconds between posts. Please try again in 10 seconds.

Ugh....