Problem with rob cmd
#1

Hello,i maked 3 checkpoints where player can /rob.

This is the rob cmd.

pawn Код:
CMD:rob(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, -1955.7682,306.0241,41.0471))
    {
    GameTextForPlayer(playerid, "Type ~r~/rob~r~ to rob ~y~Wang Cars", 3000, 5);
    }
    else if(IsPlayerInRangeOfPoint(playerid,, -2051.8413,86.1440,28.3977))
    {
    GameTextForPlayer(playerid, "Type ~r~/rob to rob ~y~San Fierro Fire Dp", 3000, 5);
    }
    else if(IsPlayerInRangeOfPoint(playerid, -2141.5591,-256.7738,40.7195))
    {
    GameTextForPlayer(playerid, "Type ~r~/rob to rob ~y~Drug Factory", 3000, 5);
    }
    if(gTeam[playerid] == TEAM_COP) return SendClientMessage(playerid, red, "Cops can't do robberies!");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You can't start a robbery if you are in a vehicle!");
    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] = 31;
    return true;
}
I want the player is able to use this command ONLY if player is in the 3 coordinates defined above.

How to?This don't work.
Reply
#2

Remove the 3 checks at the top and replace it with this:

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, -1955.7682, 306.0241, 41.0471 && !IsPlayerInRangeOfPoint(playerid,, -2051.8413,86.1440,28.3977) && !IsPlayerInRangeOfPoint(playerid, -2141.5591,-256.7738,40.7195))
return SendClientMessage(playerid, COLOR_RED, "You are not at a robbery location.");
Reply
#3

Yes but i want to show the GameText for every 3 coordinates
Reply
#4

You should put a pickup/checkpoint at the rob locations, when they enter it show the gametext, and when they type /rob check for IsPlayerIn(Dynamic)Checkpoint.
Reply
#5

Quote:
Originally Posted by MP2
Посмотреть сообщение
You should put a pickup/checkpoint at the rob locations, when they enter it show the gametext, and when they type /rob check for IsPlayerIn(Dynamic)Checkpoint.
Right,thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)