Little coding questions - For general minor queries 5

error
Code:
 error 006: must be assigned to an array
line
Code:
PlayerInfo[playerid][pEmail] = email;
Reply

how to define response on OnPlayerRequestClass(
Reply

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
can someone explain to me what VectorSize Means?
It calculates the size of the vector, it is nothing more than the Pythagorean theorem (c^2 = a^2 + b^2)
Reply

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
It calculates the size of the vector, it is nothing more than the Pythagorean theorem (c^2 = a^2 + b^2)
basically distance between two points?
Reply

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
basically distance between two points?
Yeah, the distance is nothing else than the vector between A and B, AB = B - A or BA = A - B, distance = |AB| = |BA| (|vector| = length / size of the vector)
Reply

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
But why would you consider calling it on the server than doing it on your database?

Код:
UPDATE `your_tables` SET `Password`=SHA2(Password, 256) WHERE `id` > 0
Because that simply does not hash the same as Whirlpool?

Код:
UPDATE `table` SET `raw`=SHA2("The quick brown fox jumps over the lazy dog", 256) WHERE `id` = 1
//outputs
d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
Код:
WP_Hash(buf, sizeof (buf), "The quick brown fox jumps over the lazy dog");
//outputs
B97DE512E91E3828B40D2B0FDCE9CEB3C4A71F9BEA8D88E75C4FA854DF36725FD2B52EB6544EDCACD6F8BEDDFEA403CB55AE31F03AD62A5EF54E42EE82C3FB35
Reply

I recently came into a problem with ORM. It creates an instance with the ID 0. To sort out this problem I have been trying to find out which function it creates it in.

This is an example:
pawn Код:
forward SaveSomething(playerid);
public SaveSomething(playerid)
{
    if(Something[playerid][ORM_ID] != 0) orm_update(Something[playerid][ORM_ID]);
    else
    {
        new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        printf("Error: Error saving Something for %s (%d).", PlayerName, playerid);
    }
    return 1;
}
Now, my questions is, why do I get tag mismatch when using it as an integer? I've tried printing a few, and it prints just fine as an integer.
What kind of variable are the ORM ID's?
Reply

I'd like to know how to make different colors in one line.
Reply

Quote:
Originally Posted by Alvin007
Посмотреть сообщение
I'd like to know how to make different colors in one line.
Color Embedding
Reply

Quote:
Originally Posted by Knappen
Посмотреть сообщение
I recently came into a problem with ORM. It creates an instance with the ID 0. To sort out this problem I have been trying to find out which function it creates it in.

This is an example:
pawn Код:
//CODE
Now, my questions is, why do I get tag mismatch when using it as an integer? I've tried printing a few, and it prints just fine as an integer.
What kind of variable are the ORM ID's?
Just do it without the != 0 if you only want to check if the variable is true (not false | not 0)
Or you remove the tag with _: but that would remove the sense of using tags at all (not recommended)
Alternative you could set the tag of the zero to ORM: (if thats the correct tag - check your definition)
pawn Код:
if(Something[playerid][ORM_ID])
if(_: Something[playerid][ORM_ID] != 0)
if(Something[playerid][ORM_ID] != ORM: 0)
It doesn't matter what it is, you can print everything as anything, it just read the bit-sequence and translate it in your wanted format
Reply

thx schneider ..
PHP код:
SendClientMessage(playerid,LIGHTBLUE,"============== \n Online Helpers:"); 
Now this won't make a new line for Online players, It appears on screen
Код:
==============  Online Helpers:
Reply

Is there a difference between using "++" and "+= 1" to raise something by 1?
Example:
pawn Код:
Variable[playerid] ++;
Variable[playerid] += 1;
Reply

Quote:
Originally Posted by Nero_3D
View Post
Just do it without the != 0 if you only want to check if the variable is true (not false | not 0)
Or you remove the tag with _: but that would remove the sense of using tags at all (not recommended)
Alternative you could set the tag of the zero to ORM: (if thats the correct tag - check your definition)
pawn Code:
if(Something[playerid][ORM_ID])
if(_: Something[playerid][ORM_ID] != 0)
if(Something[playerid][ORM_ID] != ORM: 0)
It doesn't matter what it is, you can print everything as anything, it just read the bit-sequence and translate it in your wanted format
Wow, I feel stupid. Haha, that was kind of obvious I guess. Thanks for the help. It was working perfectly fine with != 0 as well, just figured I could ask to get the warnings away.
Reply

Is there a way to only give one type of players the ability to use a filterscript, lets say like the boombox filterscript?
Reply

Quote:
Originally Posted by wooolly
Посмотреть сообщение
What does setting a players weapon skill actually do?
At 200, I think the player can duel wield certain weapons, and walk with two handed weapons right? Is that the only difference, or is there an increase in accuracy, or quicker reload times, or anything?
If there are any other changes it makes, what levels does it occur?
http://gta.wikia.com/Weapons_in_GTA_San_Andreas

Quote:
Originally Posted by Pacanaz
Посмотреть сообщение
Is there a way to only give one type of players the ability to use a filterscript, lets say like the boombox filterscript?
There must be a function (which manages rights) within the filterscript that can be called with CallRemoteFunction from the gamemode
You probably need to edit the filterscript to let it work
Reply

A cheater came by and spoofed some kills, the anticheat took care of him later. But until then, the server debugged the following:

Код:
22:34:29] [debug] Run time error 4: "Array index out of bounds"
[22:34:29] [debug]  Accessing element at index 333 past array upper bound 199
[22:34:29] [debug] AMX backtrace:
[22:34:29] [debug] #0 0004c7c8 in public OnPlayerDeath (15, 333, 18) from v8.36.amx
[22:34:29] [debug] Run time error 4: "Array index out of bounds"
[22:34:29] [debug]  Accessing element at index 630 past array upper bound 199
[22:34:29] [debug] AMX backtrace:
[22:34:29] [debug] #0 0004c7c8 in public OnPlayerDeath (15, 630, 39) from v8.36.amx
[22:34:29] [debug] Run time error 4: "Array index out of bounds"
[22:34:29] [debug]  Accessing element at index 575 past array upper bound 199
[22:34:29] [debug] AMX backtrace:
[22:34:29] [debug] #0 0004c7c8 in public OnPlayerDeath (15, 575, 26) from v8.36.amx
Is the cheater sending fake killerid data? Hows that even possible...
Should i need to check under every function if the ids are between MAX_PLAYERS, 0 and if INVALID_PLAYER_ID to avoid this problem?
Reply

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
A cheater came by and spoofed some kills, the anticheat took care of him later. But until then, the server debugged the following:

Код:
22:34:29] [debug] Run time error 4: "Array index out of bounds"
[22:34:29] [debug]  Accessing element at index 333 past array upper bound 199
[22:34:29] [debug] AMX backtrace:
[22:34:29] [debug] #0 0004c7c8 in public OnPlayerDeath (15, 333, 18) from v8.36.amx
[22:34:29] [debug] Run time error 4: "Array index out of bounds"
[22:34:29] [debug]  Accessing element at index 630 past array upper bound 199
[22:34:29] [debug] AMX backtrace:
[22:34:29] [debug] #0 0004c7c8 in public OnPlayerDeath (15, 630, 39) from v8.36.amx
[22:34:29] [debug] Run time error 4: "Array index out of bounds"
[22:34:29] [debug]  Accessing element at index 575 past array upper bound 199
[22:34:29] [debug] AMX backtrace:
[22:34:29] [debug] #0 0004c7c8 in public OnPlayerDeath (15, 575, 26) from v8.36.amx
Is the cheater sending fake killerid data? Hows that even possible...
Should i need to check under every function if the ids are between MAX_PLAYERS, 0 and if INVALID_PLAYER_ID to avoid this problem?
Yes, you should do a check. There are methods to spoof data that is sent to server which results in such errors.
Reply

i need id of a miner wagon, it looks something like this:
https://cdn1.iconfinder.com/data/ico..._wagon-512.png
thanks in advance!
Reply

Quote:
Originally Posted by ilijas
Посмотреть сообщение
i need id of a miner wagon, it looks something like this:
https://cdn1.iconfinder.com/data/ico..._wagon-512.png
thanks in advance!
This object doesn't exist, but you could make an empty dumpster and attach 4 wheels to it.
19589 RubbishSkipEmpty1 (only in 0.3.7)
Reply

Hello guys,

I know this question has been asked quite a few times but I still can't find any correct solution. I'm trying to skip the class selection and spawn buttons when a player connects to my server. I've done quite a few things:
  • Toggle spectating mode
  • Using timers to spawn the player
  • Returning 0 in various callbacks like OnPlayerRequestClass
None of them seems to really work because they depends on your game status (if you're in-game or back-windows). If I'm in game, everything works fine, but if I'm on my desktop and come back to the game, some functions aren't executed (SetPlayerCameraPos and stuff). Also, it seems to depend on the player ping (sometimes it works, sometimes it doesn't).

So here's my question. What is the most effective way to skip the class selection and spawn buttons? What is the most effective way to remove them from the HUD? What is the best method?

Seems like a simple question, but with SA:MP bugs & random behaviours, that's really not an easy thing to do.

Thanks for your answer,
ArchB.
Reply


Forum Jump:


Users browsing this thread: 17 Guest(s)