Rob cmd tip
#1

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.
Reply
#2

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;
}
Reply
#3

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

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.

Reply
#5

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.
Reply
#6

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....
Reply


Forum Jump:


Users browsing this thread: