Two things..
#1

Okay first I need an example how to make a temporary ban option.. like /ban [id] [time] [reason] I can do that with sscanf but I need to know how i would do the time limit? and

How can I make it so a certain character isnt allowed ina command? Like a negative sign in /givemoney, thanks!

Will rep whoever helps.
Reply
#2

You don't need to check if there is a negative sign in /givemoney, you just need to check if the value of the input is negative or not, for example:

pawn Код:
if(value < 0) // The value is less than 0 so it must be negative
As for temporary bans, you will need a way of storing the ban information persistantly, such as in an SQL server, an SQLite database or in some file structure. Then you will need to calculate the time and date that the person will be banned until, then simply check if that time and date has been passed when they join the server.
Reply
#3

Код:
C:\Documents and Settings\Customer\Desktop\Los Santos Gangwar\gamemodes\gangwar.pwn(802) : error 017: undefined symbol "value"
C:\Documents and Settings\Customer\Desktop\Los Santos Gangwar\gamemodes\gangwar.pwn(802) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
PHP код:
    if(value 0) return SendClientMessage(COLOR_GRAY,"You can not give anythin less then 0"); 
Reply
#4

I highly doubt the name of the variable where the parameter data is stored is "value", that was simply an example, you're not supposed to literally copy and paste it.

Now I do quite frankly suggest you go back to basics and start with the PAWN manuals over at CompuPhase.
Reply
#5

Like JaTochNietDan said; it's not good to copy + past things. Learn from it. Also it's:
pawn Код:
SendClientMessage(playerid, COLOR_GRAY, "You can not give anythin less then 0");
Reply
#6

My bad, I'm tired, and I know that value is the variable, and I changed it to "amount" and it still gave me an error, But I guess it's because I forgot playerid (tired) and I know about pawn, I know about sscanf, I know about variables, I have a full gangwar TDM script that I pretty much scripted myself (with help for more advanced stuff)


Thanks anyways, repped because you helped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)