Re: Little coding questions - For general minor queries 5 -
knackworst - 05.11.2011
is it the parameter called float:distance?
Re: Little coding questions - For general minor queries 5 -
KoczkaHUN - 05.11.2011
yes.
Re: Little coding questions - For general minor queries 5 -
knackworst - 06.11.2011
but I use convertffs , and with the convert there were no streamdistances give.. so what's the default streamdistance, so I know when I'm lower than the default or not
Re: Little coding questions - For general minor queries 5 -
knackworst - 13.11.2011
Idk if this is the perfect place to ask but wht is the best way to prevent players from jacking whitout killing the jacker?
Re: Little coding questions - For general minor queries 5 -
Vince - 13.11.2011
ClearAnimations();
Re: Little coding questions - For general minor queries 5 -
xZacharias - 17.11.2011
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;
}
I scripted landstal as a boolean before:
It should only one time give score +1; only when entering the vehicle for the first time, but it's giving score on every enter. What did I wrong?
Re: Little coding questions - For general minor queries 5 -
jtweak - 21.11.2011
i've got the newbiest question of them all, what is != for instanst, pvar, in my settings i set pvar!=1 (was originally 0 ) and in my script i found the functions for it, says if (getPVarInt(playerid, "PVarmoney") !=0 would i set all corresponding code like the above to match my settings to allow cross filterscript money transfer?
Re: Little coding questions - For general minor queries 5 -
Backwardsman97 - 21.11.2011
Quote:
Originally Posted by xZacharias
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;
}
I scripted landstal as a boolean before:
It should only one time give score +1; only when entering the vehicle for the first time, but it's giving score on every enter. What did I wrong?
|
pawn Код:
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;
}
Try it that way.
Re: Little coding questions - For general minor queries 5 -
antonio112 - 03.12.2011
Hey. I have a self made register / login system with dialogs. The thing is, if I enter a wrong password in the dialog, it spawns my character at 0 0 0 coords ... But the dialog doesn't disappear. How can I make it that if I enter a wrong password, it won't spawn me ?
pawn Код:
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;
}
Re: Little coding questions - For general minor queries 5 -
GeorgeBrown - 03.12.2011
Using two different MYSQL plugin can cause any problem?
Re: Little coding questions - For general minor queries 5 -
Twisted_Insane - 03.02.2012
Anyone knows how to make a ZCMD "Warn-Command"?
Re: Little coding questions - For general minor queries 5 -
s0cket - 06.02.2012
Is it possible to set all(or a scope of) items to a same value in an array in one line, without using loops? It would be fine if it was a small array, but my code has
pawn Code:
onevariable[MAX_PLAYERS][MAX_PLAYERS]
so it's quite large and needs to be updated on
OnPlayerDeath() callback. I need to set all the values or all but one value to 0, so it would be something like
pawn Code:
onevariable[all items][all items] = 0
Re: Little coding questions - For general minor queries 5 -
Y_Less - 06.02.2012
Slice wrote a "memset" function using the p-code "FILL" OpCode:
http://forum.sa-mp.com/showthread.ph...et#post1606781
But ultimately this still uses a loop internally (though a C loop so it should be faster). You can modify this to take a reference to "data[0][0]" and "len1 * len2" as the size.
Re: Little coding questions - For general minor queries 5 -
persious - 13.02.2012
I want it to only set SWAT's armour to 100, but it also gives the Murderer 100 armour.
pawn Code:
if (gTeam[playerid] == SWAT){
SetPlayerArmour(playerid, 100);
}
Re: Little coding questions - For general minor queries 5 -
s0cket - 14.04.2012
TextDrawHideForPlayer() doesn't work for some reason. When I type in "/show" it shows the textdraw and the message in chat, but when I type in "/hide" it only shows the message in chatbox and doesn't hide the textdraw. Here's the code:
pawn Код:
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;
}
}
AW: Little coding questions - For general minor queries 5 -
Nero_3D - 14.04.2012
Thats because you create the textdraw each time you call OnPlayerCommandText
The first time it creates and shows it
The second time it creates a new one and hides it (although it was already hidden)
In the end the first one is still beeing shown
Textdraws are generally generated in OnGameModeInit and they use global variables
pawn Код:
// Global
stock
Text: debugtext
;
pawn Код:
// OnGameModeInit
debugtext = TextDrawCreate(320.0, 320.0, "debug");
pawn Код:
// 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;
}
Re: AW: Little coding questions - For general minor queries 5 -
s0cket - 14.04.2012
Quote:
Originally Posted by Nero_3D
Textdraws are generally generated in OnGameModeInit and they use global variables
|
Thank you for an explanation , works fine now
Re: Little coding questions - For general minor queries 5 -
MP2 - 15.04.2012
Quote:
Originally Posted by admantis
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?
|
3*50 is 150MS, so no..
Re: Little coding questions - For general minor queries 5 -
notepad - 16.04.2012
I've a problem which I don't know how to solve.
I'm using GetPlayerWeaponState to avoid M4 reload animation, but the problem is it doesn't get called if the player is not moving.
For example, if I move forward or I release KEY_FIRE it will get called, otherwhise it will not.
Код:
if(GetPlayerWeapon(playerid) == 31 && GetPlayerWeaponState(playerid) == WEAPONSTATE_LAST_BULLET)
{
GivePlayerWeapon(playerid, 31, 49);
}
If an animation is applied and quickly cleared, reloading animation will be bypassed in the following way.
Quote:
|
Originally Posted by Infinite "loop"
Bypass
Reload
Bypass
Reload
|
Any ideas on how to do this in an efficient way? Thank you.
Re: Little coding questions - For general minor queries 5 -
admantis - 17.04.2012
Hello, how can I do (using Incognito's streamer plugin) that a dynamic object will show in every interior, except for 0?