#1

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.
Reply
#2

Код:
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;
}
Reply
#3

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!
Reply
#4

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

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;
}
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)