questions
#1

Does OnPlayerKeyStateChange gets called when someone used sprunk machines?

If not, then maybe someone knows animation name when using sprunk machines?
Reply
#2

Yes, it is, if you scripted something under the key, that you're using to buy sprunk.
Reply
#3

Original vending machines doesn't use OnPlayerKeyStateChange callback. Animations which are related with vending machines, can be found here, by using keyword vending.
Reply
#4

OnPlayerKeyStateChange is called for EVERY key that GTA: SA uses, Sprunk or not.

Quote:
Originally Posted by Onyx
View Post
Original vending machines doesn't use OnPlayerKeyStateChange callback. Animations which is related with vending machines, can be found here, by using keyword vending.
That doesn't mean it won't call the callback. You should be more explanatory in your posts to prevent people from being misled in to believing untrue information.
Reply
#5

Quote:

That doesn't mean it won't call the callback. You should be more explanatory in your posts to prevent people from being misled in to believing untrue information.

Yehh
SA-MP team should give us "OnPlayerUsingSprunkMachine(playerid,machineid )" for situations like this, hehe
Reply
#6

Quote:
Originally Posted by Calg00ne
View Post
OnPlayerKeyStateChange is called for EVERY key that GTA: SA uses, Sprunk or not.



That doesn't mean it won't call the callback. You should be more explanatory in your posts to prevent people from being misled in to believing untrue information.
I was wrong, but you corrected my fault. So we both learned from our mistakes. Nobody can be perfect. At least, I'm trying to help.
Reply
#7

OK, thanks, now another problem.. >_>


So, I my anti text/command spam script a bit, and its stop working. When I use 1-3 commands, it likes freezes the server when using commands, and anti text spam - I can spam howmuch I want.

I tried to test it with new.pwn, same.

Script, with it I tested it:


pawn Code:
#include "..\pawno\include\a_samp.inc"
#include "..\pawno\include\zcmd.inc"

new CommandSpam[MAX_PLAYERS], TextSpam[MAX_PLAYERS];

main(){}

public OnPlayerText(playerid)
{
    if(TextSpam[playerid] != 0 && gettime() > TextSpam[playerid]) return 0;
    TextSpam[playerid] = gettime() + 2;
    return 1;
}

public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(CommandSpam[playerid] != 0 && gettime() > CommandSpam[playerid]) return 0;
    CommandSpam[playerid] = gettime() + 2;
    return 1;
}

CMD:pirma(playerid, params[]) return SendClientMessage(playerid, -1, "{33AA33}Komanda NR. 1");

CMD:antra(playerid, params[]) return SendClientMessage(playerid, -1, "{33AA33}Komanda NR. 2");

CMD:info(playerid, params[])
{
    new sz_String[69];
    format( sz_String, 69, "{FFFFFF}Text Spam - {33AA33}%d\n{FFFFFF}Command Spam - {33AA33}%d", TextSpam[playerid], CommandSpam[playerid]);
    ShowPlayerDialog(playerid,  1339, DIALOG_STYLE_MSGBOX, "{FFFFFF}Info", sz_String, "Close", "" );
    return 1;
}
Reply
#8

So, anyone knows where's the problem? :X
Reply
#9

^^^^... :<>
Reply
#10

Why are you checking if the current UNIX timestamp is bigger than the TextSpam value? Also, I think you should use GetTickCount() for more precise measurement since you are dealing with times 1-2 seconds. You could make your anti-spam script better if you actually checked if one line is being repeated constantly or spammed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)