Warning 202 - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Warning 202 (
/showthread.php?tid=529253)
Warning 202 -
Sarra - 01.08.2014
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.
Re: Warning 202 -
Konstantinos - 01.08.2014
The parameters are 5 (playerid, range, x, y, z) and you only used 4. Add "playerid" before 5.
Re: Warning 202 -
ReD_HunTeR - 01.08.2014
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?
Re: Warning 202 -
Sarra - 01.08.2014
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
Re: Warning 202 -
Sarra - 01.08.2014
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