27.01.2012, 14:28
Hello,i maked 3 checkpoints where player can /rob.
This is the rob cmd.
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.
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;
}
How to?This don't work.