Posts: 276
Threads: 17
Joined: Apr 2006
Reputation:
0
You could use ******'s hooking method to be simpler the use.
Good job burned cat.
Posts: 947
Threads: 58
Joined: Nov 2011
Reputation:
0
Pink pause menu.
OT: nice.
Posts: 2,938
Threads: 162
Joined: May 2010
I don't see your need for all those timers and health stuff?
pawn Код:
new PlayerUpdate[MAX_PLAYERS char], // less than 255 players, change it yourself if needed..
Paused[MAX_PLAYERS];
forward OnPlayerPause(playerid);
forward OnPlayerUnPause(playerid);
forward IsPlayerPaused(playerid);
public IsPlayerPaused(playerid) return Paused[playerid];
public OnPlayerUpdate(playerid)
{
if(PlayerUpdate{playerid} >= 2)
{
Paused[playerid] = 0;
CallRemoteFunction("OnPlayerUnPause", "i", playerid);
}
PlayerUpdate{playerid} = 0;
return 1;
}
public OnPlayerPause(playerid)
{
printf("[System] - %s(%d) Has Paused", Playername(playerid), playerid);
return 1;
}
public OnPlayerUnPause(playerid)
{
printf("[System] - %s(%d) Has Unpaused", Playername(playerid), playerid);
return 1;
}
// in a preferably 1 second timer
if(PlayerUpdate{i} < 2)
{
PlayerUpdate{i}++;
}
else
{
if(Paused[i] != 1)
{
CallRemoteFunction("OnPlayerPause", "i", i);
Paused[i] = 1;
}
}
Posts: 410
Threads: 88
Joined: Oct 2008
Reputation:
0
Very nice.
Btw a suggestion, maybe check if foreach is included and use it in the players loop?
Posts: 2,938
Threads: 162
Joined: May 2010
Quote:
Originally Posted by FireCat
Why don't you go around all SA-MP forums and copy paste all the codes of "OnPlayerPause" detections too?
They all work!
|
No, my internet chipped so I couldn't edit it. Anyway... I don't see your use in "CheckPlayerHealth" yours is less efficient.. and I made that one...
Also your randomly changing players health? what if they are 0.1 from deathmatching and your code kills them huh? (1.5 second timer..)
You seriously want to discriminate, i'll point out even more bad stuff.
You should hook your callbacks ;\
I MEAN YOUR SERIOUSLY MAKING 1000 TIMERS FOR 1000 PLAYERS, UNDERSTAND
??
and for(new i; i != GetMaxPlayers();i++) ... don't call GetMaxPlayers() every time
Posts: 3,793
Threads: 196
Joined: Jan 2010
Reputation:
0
You forgot to hook your callbacks.
Posts: 2,334
Threads: 62
Joined: Dec 2009
Reputation:
0
5000ms to detect if a player pauses? LOL and hook your callbacks