Difference problem - 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: Difference problem (
/showthread.php?tid=416094)
Difference problem -
Noles2197 - 16.02.2013
I want it to prevent the player from fishing any further when the player's fish value is greater than 16,000 ounces. However, when a player just starts fishing, it says, "You've reached the fishing limit!" when you have 0 ounces.
pawn Код:
new fish[MAX_PLAYERS];
CMD:fish(playerid,params[])
{
if(pInfo[playerid][Job]==2)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid))==453)
{
if(IsPlayerInRangeOfPoint(playerid,32,-1086.7250,651.5926,-0.3300))
{
if(fish[playerid]>16000) // here
{
if(worms[playerid]>1)
{
new str[128];
format(str,sizeof(str),"** %s cast out their fishing line.",GetName(playerid));
ProxDetector(30,playerid,str,COLOR_PURPLE);
worms[playerid]--;
defer fWait(playerid);
}
else SendClientMessage(playerid,COLOR_RED,"You have no worms!");
}
else SendClientMessage(playerid,COLOR_RED,"You've reached the fishing limit!");
}
else CreateDynamicCP(-1086.7250,650.5926,-0.3300,32,-1,-1,-1,320);
}
else SendClientMessage(playerid,COLOR_RED,"You're not in a Reefer!");
}
return 1;
}
Re: Difference problem -
Camacorn - 16.02.2013
Код:
new fish[MAX_PLAYERS];
CMD:fish(playerid,params[])
{
if(pInfo[playerid][Job]==2)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid))==453)
{
if(IsPlayerInRangeOfPoint(playerid,32,-1086.7250,651.5926,-0.3300))
{
if(fish[playerid]<16000) // here
{
if(worms[playerid]>1)
{
new str[128];
format(str,sizeof(str),"** %s cast out their fishing line.",GetName(playerid));
ProxDetector(30,playerid,str,COLOR_PURPLE);
worms[playerid]--;
defer fWait(playerid);
}
else SendClientMessage(playerid,COLOR_RED,"You have no worms!");
}
else SendClientMessage(playerid,COLOR_RED,"You've reached the fishing limit!");
}
else CreateDynamicCP(-1086.7250,650.5926,-0.3300,32,-1,-1,-1,320);
}
else SendClientMessage(playerid,COLOR_RED,"You're not in a Reefer!");
}
return 1;
}
You used the "greater than" symbol instead of the "less than" symbol, copy the code above into your gm.