SA-MP Forums Archive
Ban - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ban (/showthread.php?tid=388738)



Ban - Akcent_Voltaj - 30.10.2012

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;
                       }
                       } 



Re: Ban - DBan - 30.10.2012

What errors are you getting? And on which lines?


Re: Ban - Alex Magaсa - 30.10.2012

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! 
?


Re: Ban - DBan - 30.10.2012

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



Re: Ban - Akcent_Voltaj - 30.10.2012

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]
                                                               
// 



Re : Ban - Akcent_Voltaj - 30.10.2012

fixed


Re: Ban - Alex Magaсa - 30.10.2012

You forgot to put }return 1;


Re: Ban - Akcent_Voltaj - 30.10.2012

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??


Re: Ban - [HK]Ryder[AN] - 30.10.2012

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