16.12.2012, 16:09
Ok so for my /suit up command for the EMT's in my server I have it where they must be in range of one of the defined points, the problem is is that it works everywhere. Whats wrong with the code and why isn't it JUST working at the points?
It should work in the Hospital, the Fire Dept #1, the Fire Dept. #2, the Ambulance Interior, If they are in an firetruck, and if they are in an ambulance.
Here is the code:
Thanks: jakejohnsonusa
PS: I get no errors in the code.
It should work in the Hospital, the Fire Dept #1, the Fire Dept. #2, the Ambulance Interior, If they are in an firetruck, and if they are in an ambulance.
Here is the code:
pawn Код:
if(strcmp(cmd, "/suitup", true) == 0)
{
if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
{
new carid = GetPlayerVehicleID(playerid);
if (IsPlayerInRangeOfPoint(playerid, 3.0, 2811.7837,-1167.3248,1025.5703) || IsPlayerInRangeOfPoint(playerid, 3.0, 1924.24,-1876.71,12.94) || IsPlayerInRangeOfPoint(playerid, 3.0, 1222.1793,-1246.3489,1287.8243) || IsPlayerInRangeOfPoint(playerid, 3.0, 2003.3, 2284.2, 1011.1) || IsAFiremenCar(carid) || IsAnAmbulance(carid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid,0xFF0000FF,"USAGE: /suitup [Suit 1-6]");
return 1;
}
suitup = strval(tmp);
if(suitup < 1 || suitup > 6) {
SendClientMessage(playerid,0xFF0000FF,"USAGE: /suitup [Suit 1-6]");
return 1;
}
if(suitup == 1) {
SetPlayerSkin(playerid, 274);
SafeResetPlayerWeapons(playerid);
SetPlayerColor(playerid, 0xFF828200);
// The rest isn't needed for this post.
PS: I get no errors in the code.