SA-MP Forums Archive
Help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help (/showthread.php?tid=148435)



Help - ViruZZzZ_ChiLLL - 17.05.2010

Okay, so I'm planning on making a Fishing FS.
But, how can I make sure that he/she's on the water and
a is on a boat before he can use /fish.


Re: Help - aircombat - 17.05.2010

Код:
new AbleToFish[MAX_PLAYERS];
Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
new modelid = GetVehicleModel(vehicleid);
if(modelid = Boat)
{
AbleToFish[playerid] = 1;
}
return 1;
}
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
     AbleToFish[playerid] = 0;
	return 1;
}
Код:
dcmd_fish(playerid,params[])
if(AbleToFish[playerid] == 1)
{
//command
}
return 1;
}



Re: Help - ViruZZzZ_ChiLLL - 17.05.2010

Quote:
Originally Posted by Etch ❽ H
Код:
new AbleToFish[MAX_PLAYERS];
Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
new modelid = GetVehicleModel(vehicleid);
if(modelid = Boat)
{
AbleToFish[playerid] = 1;
}
return 1;
}
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
     AbleToFish[playerid] = 0;
	return 1;
}
Код:
dcmd_fish(playerid,params[])
if(AbleToFish[playerid] == 1)
{
//command
}
return 1;
}
Okay, okay, tyvm Etch!


Re: Help - ViruZZzZ_ChiLLL - 17.05.2010

Okay, I need help again on how he can't
use the command /fish for the next minute


Re: Help - Futurezx - 17.05.2010

not sure but maybe this:
Код:
dcmd_fish(playerid,params[])
if(AbleToFish[playerid] == 1)
{
//command
AbleToFish[playerid] = 0;
SetTimer ("fishagain", 60000, false);
}
return 1;
}
then
Код:
forward fishagain(playerid);
public fishagain(playerid)
{
AbleToFish[playerid] = 1;
return 1;
}



Re: Help - Naxix - 17.05.2010

Quote:
Originally Posted by pwn.exe
not sure but maybe this:
Код:
dcmd_fish(playerid,params[])
if(AbleToFish[playerid] == 1)
{
//command
AbleToFish[playerid] = 0;
SetTimer ("fishagain", 60000, false);
}
return 1;
}
then
Код:
forward fishagain(playerid);
public fishagain(playerid)
{
AbleToFish[playerid] = 1;
return 1;
}
I would prob use "SetTimerEx" to get the right id, as that one would just set a timer on for every1 on the server.