05.11.2011, 11:41
is it the parameter called float:distance?
if(GetVehicleModel(vehicleid) == 400) { if(landstal == false) { landstal = true; SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); return 0; } else return 1; }
new bool:landstal;
I don't know where the failure is. I scripted on OnPlayerEnterVehicle:
Код:
if(GetVehicleModel(vehicleid) == 400) { if(landstal == false) { landstal = true; SetPlayerScore(playerid, GetPlayerScore(playerid) + 1); return 0; } else return 1; } Код:
new bool:landstal; |
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 400)
{
if(!landstal)
{
landstal = true;
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
}
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadPassword_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD,""CWH"Login",""CWH"Introdu parola mai jos pentru a te loga.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT,""CWH"Inregistrare...",""CWH"Introdu o parola mai jos pentru a-ti crea un account.","Inregistreaza","Iesi");
}
return 1;
}
onevariable[MAX_PLAYERS][MAX_PLAYERS]
onevariable[all items][all items] = 0
if (gTeam[playerid] == SWAT){
SetPlayerArmour(playerid, 100);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new Text:debugtext;
debugtext = TextDrawCreate(320,320,"debug");
if(!strcmp(cmdtext, "/show", true))
{
TextDrawShowForPlayer(playerid, debugtext);
SendClientMessage(playerid, 0xFFFFFFFF, "textdraw on");
return 1;
}
if(!strcmp(cmdtext, "/hide", true))
{
TextDrawHideForPlayer(playerid, debugtext);
SendClientMessage(playerid, 0xFFFFFFFF, "textdraw off");
return 1;
}
}
// Global
stock
Text: debugtext
;
// OnGameModeInit
debugtext = TextDrawCreate(320.0, 320.0, "debug");
// OnPlayerCommandText
if(!strcmp(cmdtext, "/debug", true)) {
static
bool: show
;
if((show = !show)) {
TextDrawShowForPlayer(playerid, debugtext);
SendClientMessage(playerid, 0xFFFFFFFF, "textdraw on");
} else {
TextDrawHideForPlayer(playerid, debugtext);
SendClientMessage(playerid, 0xFFFFFFFF, "textdraw off");
}
return true;
}
I made a big gamemode with a "core" timer that handles every player operation requiring timing. The interval is 1000 ms, and debugging I found out that only by myself (it has a few of foreach loops and stuff) the whole timer (about 1000 lines of code!) takes 2-3 ms to be called.
Will this present problems on the future when I have about 40 or even 50 players? |
if(GetPlayerWeapon(playerid) == 31 && GetPlayerWeaponState(playerid) == WEAPONSTATE_LAST_BULLET) { GivePlayerWeapon(playerid, 31, 49); }
Originally Posted by Infinite "loop"
Bypass
Reload Bypass Reload |