24.09.2011, 18:05
Quote:
Thats here is my try
Код:
public OnPlayerUpdate(playerid) { if(IsPlayerInRangeOfPoint(playerid, 30.0, 4621.3721,-5468.7544,16.0294)) { GivePlayerMoney(playerid, LiveMoney); SetPlayerPos(playerid,1359.2667,-2667.1755,13.5391); } new StopMessage = 0; if( StopMessage == 0 ) { StopMessage = 1; } else { SendClientMessage(playerid,0x21DD00FF,"[Greats]: You have FINISHED the /drag race!"); new pName[MAX_PLAYER_NAME]; new string[128]; GetPlayerName(playerid, pName, 30); format(string, 128, "{09FE00}[Race]: {FFFFFF}%s {09FE00}have finished the {FFFFFF}(/drag){09FE00} race.", pName); SendClientMessageToAll(COLOR_LIGHTBLUE, string); } return 1; // Send this update to other players. } |
You need to rethink what you are doing. No one here will recommend that you do what you are trying to do in OnPlayerUpdate you must think of a better way. OnPlayerUpdate is called X amount of times in a millisecond (its actual what your OnFoot, Incar, Weapon rates are) so let say using the default setting of 40 you are running that check 40 times in a millisecond. You can get the info here: https://sampforum.blast.hk/showthread.php?pid=417583#pid417583 So you really need to think about what you are trying to do and do you need to check those conditions 40 times in a millisecond. I highly doubt it.