#1

a friend gave me a ban sistem but i get errors.


PHP код:
 if(strcmp(cmd"/testban"true) == 0//
                    
{
                    new 
Target;
                    new 
Reason[100];
                    if(!
sscanf(params"us[100]"Target,Reason) == ERROR Undentified params and i have sscanf2 as include!
                    {
                    if(
Target == playerid) return SendClientMessage(playerid,-1,"lol want to ban your self?");
                    new 
tname[MAX_PLAYER_NAME];
                    
GetPlayerName(Target,tname,sizeof(tname));
                    new 
pname[MAX_PLAYER_NAME];
                    
GetPlayerName(playerid,pname,sizeof(pname));
                    new 
MyString[256];
                    new 
TargetString[256];
                    new 
rbandate[3];
                    
getdate(rbandate[0],rbandate[1],rbandate[2]);
                    
format(MyString,sizeof(MyString),"You Have Banned %s(%d)! (Reason %s)",tnameTarget,Reason);
                    
ShowPlayerDialog(playerid1000DIALOG_STYLE_MSGBOX,"You Have Been Banned :(",TargetString"OK""");
                    
SendClientMessageToAll(-1,MyString);
                    new 
AllString[256];
                     
format(AllString,sizeof(AllString),"Admin %s has banned player %s(%d)! Reason(%s)"pname,tname,Target,Reason);
                     
SendClientMessageToAll(-1,AllString);
                     new 
ip[50];
                     
GetPlayerIp(Target,ip,sizeof(ip));
                     
strdel(ip,strlen(ip)-4,strlen(ip));
                     
format(ip,sizeof(ip),"%s**.**",ip);
                     
format(ip,sizeof(ip),"banip %s",ip);
                     
SendRconCommand(ip);
                      
Ban(Target);
                       return 
1;
                       }
                       } 
Reply
#2

What errors are you getting? And on which lines?
Reply
#3

Quote:
Originally Posted by DBan
Посмотреть сообщение
What errors are you getting? And on which lines?
is this the error?
PHP код:
                    if(!sscanf(params"us[100]"Target,Reason) == ERROR Undentified params and i have sscanf2 as include! 
?
Reply
#4

Change
pawn Код:
if(!sscanf(params, "us[100]", Target,Reason)
to
pawn Код:
if(!sscanf(params, "us[100]", Target,Reason))
Reply
#5

i fixed it but i get these warnings

PHP код:
(8129) : warning 209: function "dcmd_testban" should return a value
(8140) : warning 209: function "dcmd_test" should return a value 
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
                    {
                    
dcmd(testban4cmdtext);
                    
dcmd(test5cmdtext);
                    new 
string[256];
                    new 
playermoney;
                    new 
sendername[MAX_PLAYER_NAME]
                                                               
// 
Reply
#6

fixed
Reply
#7

You forgot to put }return 1;
Reply
#8

diffrent problem!

so i have hack to test and at a limo i put wheels that makes server crash..is there an thingy that bannes invalid components??
Reply
#9

something like this?
https://sampforum.blast.hk/showthread.php?tid=317303
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)