Problem With Script: all players are afk - 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: Problem With Script: all players are afk (
/showthread.php?tid=566843)
Problem With Script: all players are afk -
Fantje - 08.03.2015
Heey
I have a script but won't work. It is a script to auto open a gate when in area of gate. ONLY if you are donator rank.
The gate works but it bugs: I can see all players but some players are "AFK" in-game when they aint AFK.
I know, return 0; doesn't need here, but if I don't put it there I get a lot of errors and I tried everything. Also return 1; Is double because the script won't work because of the errors.
My script (BAD):
PHP код:
public OnPlayerUpdate(playerid){
if(PlayerInfo[playerid][dRank]<1)
return 0;
{
if(IsPlayerInRangeOfPoint(playerid,8,-308.49820, 1508.65869, 74.33560))
{
MoveObject(autogate,-308.49820, 1508.65869, 68.10109,3);
SetTimer("close",4000,0);
return 1;
}
return 1;
}
}
Who can fix it?
Re: Problem With Script: all players are afk -
Misiur - 08.03.2015
pawn Код:
public OnPlayerUpdate(playerid)
{
if(PlayerInfo[playerid][dRank] < 1 && IsPlayerInRangeOfPoint(playerid, 8, -308.49820, 1508.65869, 74.33560))
{
MoveObject(autogate, -308.49820, 1508.65869, 68.10109, 3);
SetTimer("close", 4000, 0);
}
return 1;
}
Ever heard of indentation? If you want your code to be readable - ****** it, and use it.
Re: Problem With Script: all players are afk -
Fantje - 08.03.2015
It compiles now
Re: Problem With Script: all players are afk -
Fantje - 08.03.2015
Quote:
Originally Posted by Misiur
pawn Код:
public OnPlayerUpdate(playerid) { if(PlayerInfo[playerid][dRank] < 1 && IsPlayerInRangeOfPoint(playerid, 8, -308.49820, 1508.65869, 74.33560)) { MoveObject(autogate, -308.49820, 1508.65869, 68.10109, 3); SetTimer("close", 4000, 0); }
return 1; }
Ever heard of indentation? If you want your code to be readable - ****** it, and use it.
|
The code you give don't work! My gate wont open if you stand infront of int
Re: Problem With Script: all players are afk -
SKAzini - 08.03.2015
You're checking if dRank is less than 1, isn't this the source of your problem?