need 2 things
#1

hi,
(1)i need /teleson and /telesoff command that no one can teleport when me when i type /telesoff and he can tele me when i type /teleson
(2)I Want Anti Cmd Spam That When I Type the same cmd in 3 time it warn but don't kick
Reply
#2

1.
Make a global variable and on /telesoff set it to 1. On /teleson set it to 0. Then on any teleport command
pawn Code:
if( The_Global_Variable == 1) return SendClientMessage( playerid, -1, "It's disabled" );
Reply
#3

1- make a variable who check if the teleson=1 telepoprts allowed else if teleson=0 they can not teleport
2- and for the anti-spam CMD u need a timer i think ...
Reply
#4

2) OnPlayerText save a variable with the text and another variable for the times the player has spammed. And if the player said the same thing again (use strcmp), increase the times variable. If you don't get it, just wait an hour and i'll script it.
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=187229
It's there for a reason.
Reply
#6

Quote:
Originally Posted by Dwane
View Post
1.
Make a global variable and on /telesoff set it to 1. On /teleson set it to 0. Then on any teleport command
pawn Code:
if( The_Global_Variable == 1) return SendClientMessage( playerid, -1, "It's disabled" );
no i don't mean disable teleport commands i mean when i type /teleoff No One Can Teleport Me
Quote:
Originally Posted by ServerScripter
View Post
1- make a variable who check if the teleson=1 telepoprts allowed else if teleson=0 they can not teleport
I Said No One Can't Teleport Me When I Type /Telesoff
Quote:
Originally Posted by king_hual
View Post
2) OnPlayerText save a variable with the text and another variable for the times the player has spammed. And if the player said the same thing again (use strcmp), increase the times variable. If you don't get it, just wait an hour and i'll script it.
WTH I Said Anti COMMAND Spammer
Reply
#7

For the teleport toggling, you need an array, which if set to 1 disables teleports for that player.

pawn Code:
new pTele[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    pTele[playerid] = 0; // Reset when players joins
    return 1;
}

// In the /teleoff command:
pTele[playerid] = 1;

// In the /teleon command:
pTele[playerid] = 0;

// In the /goto command or whatever
if(pTele[gotoid] == 1) return SendClientMessage(.. error ..);
For command anti-spam, there's various ways to do it. One way is to have two arrays, one for the spam count and one for a timer.

Using GetTickCount you can add one to the spamcount if they say something shortly after their last message. If it equals to 3, warn them.
Reply
#8

Quote:
Originally Posted by misho1;
WTH I Said Anti COMMAND Spammer
Then change it to OnPlayerCommandText obv.
*facepalms*
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)