Warning 202
#1

Hi, My command /repair is getting a warning 202 message
pawn Код:
if (strcmp(cmdtext, "/repair", true) == 0 )
    {
        if (!IsPlayerInAnyVehicle(playerid) )
        {
        SendClientMessage(playerid, 0xFF0000AA, "You must be in a vehicle to repair it");
        return 1;
        }
        else if (!IsPlayerInRangeOfPoint(5, 1607.2327, -1841.8683, 13.5116) )
        {
        SendClientMessage(playerid, 0xFF0000AA, "You are not at the Mechanic Place please get to there then /repair, use /whereismech to find the location");
        return 1;
        }
        else
        {
         RepairVehicle(GetPlayerVehicleID(playerid));
         PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
         GivePlayerMoney (playerid, -5000);
         SendClientMessage(playerid, 0xFFC0C0C0, "You have repaired your vehicle and paid 5,000$ for it");
         return 1;
        }

    }
Line causing the Warning
pawn Код:
else if (!IsPlayerInRangeOfPoint(5, 1607.2327, -1841.8683, 13.5116) )
PS: I'm a Beginner.
Reply
#2

The parameters are 5 (playerid, range, x, y, z) and you only used 4. Add "playerid" before 5.
Reply
#3

pawn Код:
if(strcmp(cmdtext, "/repair", true) == 0)
    {
       if(!IsPlayerInAnyVehicle(playerid)) return  SendClientMessage(playerid, 0xFF0000AA, "You must be in a vehicle to repair it");
       if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1607.2327, -1841.8683, 13.5116)) return SendClientMessage(playerid, 0xFF0000AA, "You are not at the Mechanic Place please get to there then /repair, use /whereismech to find the location");
       RepairVehicle(GetPlayerVehicleID(playerid));
       PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
       GivePlayerMoney (playerid, -5000);
       SendClientMessage(playerid, 0xFFC0C0C0, "You have repaired your vehicle and paid 5,000$ for it");
       return 1;
    }
try this?
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The parameters are 5 (playerid, range, x, y, z) and you only used 4. Add "playerid" before 5.
That's it, thanks alot +rep
Reply
#5

Quote:
Originally Posted by BlackBomb
Посмотреть сообщение
pawn Код:
if(strcmp(cmdtext, "/repair", true) == 0)
    {
       if(!IsPlayerInAnyVehicle(playerid)) return  SendClientMessage(playerid, 0xFF0000AA, "You must be in a vehicle to repair it");
       if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1607.2327, -1841.8683, 13.5116)) return SendClientMessage(playerid, 0xFF0000AA, "You are not at the Mechanic Place please get to there then /repair, use /whereismech to find the location");
       RepairVehicle(GetPlayerVehicleID(playerid));
       PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
       GivePlayerMoney (playerid, -5000);
       SendClientMessage(playerid, 0xFFC0C0C0, "You have repaired your vehicle and paid 5,000$ for it");
       return 1;
    }
thanks, The problem was with the parameter "playerid" , +rep

try this?
thanks, The problem was with the parameter "playerid" , +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)