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;
}
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.");
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.
|