16.02.2013, 19:45
I'm trying to make it to where if they player is in range of any one of these fishing poles I've made, it will allow them to fish, but I just keep getting the message:
"You're not at the pier!"
"You're not at the pier!"
pawn Код:
public OnGameModeInit()
{
CreateObject(18632,-2997.06,460,5.16,180,45,0);
CreateObject(18632,-2997.06,465,5.16,180,45,0);
CreateObject(18632,-2997.06,470,5.16,180,45,0);
CreateObject(18632,-2997.06,475,5.16,180,45,0);
CreateObject(18632,-2997.06,480,5.16,180,45,0);
return 1;
}
CMD:fish(playerid,params[])
{
if(pInfo[playerid][Job]==2)
{
new Float:x,Float:y,Float:z;
GetObjectPos(18632,x,y,z);
if(IsPlayerInRangeOfPoint(playerid,2,x,y,z))
{
if(fish[playerid]<2000)
{
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);
TogglePlayerControllable(playerid,0);
worms[playerid]--;
defer fWait(playerid);
}
else SendClientMessage(playerid,COLOR_RED,"You have no worms!");
}
else SendClientMessage(playerid,COLOR_RED,"You've reached the limit!");
}
else SendClientMessage(playerid,COLOR_RED,"You're not at the pier!");
}
return 1;
}