OnPlayerSwitchWeapon function without OnPlayerUpdate ?
#1

Hello. I am looking for a function like OnPlayerSwitcWeapon but doesn't use RAM. It exists ?

(Je parle aussi franзais)
Reply
#2

Look for Timers in your script...which are looping through all players..

and there you can place the code from onplayerupdate too..

btw it's not ram, it's cpu that is used by onplayerupdate
Reply
#3

« Would help if you handed out some code to aid in making this command, but you know, Scripting Help isn't really for making you a command...
But if someone was going to be kind, then they'd need some basis to go on, rather than nothing and guess everything. » - Sew_Suni

Oui on a besoin qui tu codes un minimum pour que l'on puisse t'aider.
Reply
#4

Non mais je veux dire, le script OnPlayerSwitchWeapon on peut le crйer comme зa :
Quote:

new lastWeapon[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
lastWeapon[playerid] = 0;
return 1;
}

public OnPlayerUpdate(playerid)
{
new w = GetPlayerWeapon(playerid);
if(w != lastWeapon[playerid])
{
OnPlayerChangeWeapon(playerid, w, lastWeapon[playerid]);
}
lastWeapon[playerid] = w;
return 1;
}

OnPlayerChangeWeapon(playerid, newgun, oldgun)
{
return 1;
}

Mais зa use de la RAM et pour un serveur de 200 joueurs c'est pas top... Je voulais savoir si зa existe sans utiliser OnPlayerUpdate.
Reply
#5

D: code looks pretty messy. In my opinion
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)