[FilterScript] [FILTERSCRIPT] Xtreme Admin System || Version: 2.2 • SA:MP 0.2.2-r2 • Click Me!
#21

Quote:

}
if(strcmp(cmd,"/say",true)==0) {
if(Level[playerid] >= 1 && LoggedIn[playerid] == 1) {
if ((strlen(cmdtext) == 3)||(strlen(cmdtext) == 4)) { SendClientMessage(playerid,red, "Syntax: /say <text>"); return 1; }
if ((strlen(cmdtext[5]) >= 2) && (strlen(cmdtext[5]) <= 150)) { format(string,sizeof(string),"(%s) %s",name,cmdtext[5]); SendMessageToAdmins(string); }
else SendClientMessage(playerid,red,"Error: The length of your message must be between 2 and 150!");
} else SendClientMessage(playerid,red,"Error: You must be logged in as administrator level 1+.");
return 1;
}


What is here wrong that is the Code that i have in my .pwn and .amx!!!
So why does the Server send the massage so offten:

<Cooldown> Hi
<Cooldown> Hi
<Cooldown> Hi
<Cooldown> Hi
<Cooldown> Hi
<Cooldown> Hi
<Cooldown> Hi

??


The Server does no laggs anymore! (I have fix it=> The /akill command has do the lags)
But i have the /say command! (See in the start of post)


plz help!




Your
Cooldown
Reply
#22

I have no idea why, it doesn\'t seem to do that on my or my friend\'s servers :S Did you get the patched version?

EDIT- You may try changing \'cmd\' to \'cmdtext\' in the first if statement due to the fact you aren\'t tokening any strings or using it in the command!

P.S. Don\'t forget to include the function whilst posting...

EDIT- Be sure that you didn\'t remove or change the names of variables, or else this might
occur.

[code=Changed Say Command]if(strcmp(cmdtext,"/say",true)==0) {
if(Level[playerid] >= 1 && LoggedIn[playerid] == 1) {
if ((strlen(cmdtext) == 3)||(strlen(cmdtext) == 4)) { SendClientMessage(playerid,red, "Syntax: /say <text>"); return 1; }
if ((strlen(cmdtext[5]) >= 2) && (strlen(cmdtext[5]) <= 150)) { format(string,sizeof(string),"(%s) %s",name,cmdtext[5]); SendMessageToAdmins(string); }
else SendClientMessage(playerid,red,"Error: The length of your message must be between 2 and 150!");
} else SendClientMessage(playerid,red,"Error: You must be logged in as administrator level 1+.");
return 1;
}[/code]

[code=Admin Message Sender]public SendMessageToAdmins(text[]) {
for(new i = 0; i < MAX_PLAYERS; i++) {
new name[MAX_PLAYER_NAME]; GetPlayerName(i,name,sizeof(name));
new file[256]; format(file,sizeof(file),"/xadmin/%s.ini",udb_encode(name));
if (LoggedIn[i] == 1 && Registered[i] == 1 && Level[i] >= 1) SendClientMessage(i,cyan,text);
}
return 1;
}[/code]
Reply
#23

HI again!

X-treme , are you asked me , to reply what the commands i want to work.
For examle: in my GAMEMODE theres Teleport commands like /tele-...... or LAWS like /laws.We wanna use it in the game, but when your Admin script is active this commands are blocked (when i type it, it dont work).

Please help me!

Sry for my english!
Reply
#24

I guarantee it is not a fault of my script, perhaps the gamemode itself doesn\'t accept filterscripts? It would be a bunch easier to figure out the problem if you displayed your gamemode source :P
Reply
#25

Re!
You can see my source code here: http://pastebin.com/881680
Reply
#26

Okay I have found the solution...

Comment off the strtok() function in your script because there is no need for it based on your existing commands, plus it is messing up all the commands in my filterscript.

pawn Code:
/*strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= \' \'))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}*/
And finally replace all cmd\'s in your script with cmdtext (the only time you would use strtok() is when you are doing commands with id numbers and such).

Example:
change
pawn Code:
if (strcmp(cmd, "/segitseg", true)==0)
to
pawn Code:
if (strcmp(cmdtext, "/segitseg", true)==0)
Reply
#27

Thx man , i\'ll try this when i\'am get home

Reply
#28

I was made the changes that you\'re suggested but it\'s still don\'t work .
Another Suggestion?
Reply
#29

well it obviously has to be the gamemode itself...have you tried other modes with it?
Reply
#30

This is one of the best admin scripts i\'ve seen
I got some ideas for your next version if u are planning 1.
heres a list:
giveallweapon
setskinall
admin chat

i know i have more but just cant think of em



Reply
#31

I CANT COMPILE IN PAWN

THIS IS THE ERROR

Quote:

C:\Documents and Settings\Sherry\Desktop\sa-mp server\pawno\include\dutils.inc(27) : error 017: undefined symbol "MAX_PLAYERS"
C:\DOCUME~1\Sherry\Desktop\SA-MPS~1\FILTER~1\src\xadmin.pwn(16) : error 017: undefined symbol "MAX_PLAYERS"
C:\DOCUME~1\Sherry\Desktop\SA-MPS~1\FILTER~1\src\xadmin.pwn(16) : error 009: invalid array size (negative or zero)
C:\DOCUME~1\Sherry\Desktop\SA-MPS~1\FILTER~1\src\xadmin.pwn(17) : error 017: undefined symbol "MAX_PLAYERS"
C:\DOCUME~1\Sherry\Desktop\SA-MPS~1\FILTER~1\src\xadmin.pwn(17) : error 009: invalid array size (negative or zero)
C:\DOCUME~1\Sherry\Desktop\SA-MPS~1\FILTER~1\src\xadmin.pwn(27) : error 017: undefined symbol "MAX_PLAYER_NAME"
C:\DOCUME~1\Sherry\Desktop\SA-MPS~1\FILTER~1\src\xadmin.pwn(27) : error 009: invalid array size (negative or zero)
C:\DOCUME~1\Sherry\Desktop\SA-MPS~1\FILTER~1\src\xadmin.pwn(27) : error 036: empty statement
C:\DOCUME~1\Sherry\Desktop\SA-MPS~1\FILTER~1\src\xadmin.pwn(27) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.0.3367 Copyright © 1997-2005, ITB CompuPhase


9 Errors.

Reply
#32

Do you have an include called #include <a_samp> above main?
Reply
#33

sorry but what do you mean above main
Reply
#34

ahhhhh i see i had betamasters modded a_samp.inc for his game mode wich is now dead
Reply
#35

Quote:
Originally Posted by Lilweeziana
This is one of the best admin scripts i\'ve seen
I got some ideas for your next version if u are planning 1.
heres a list:
giveallweapon
setskinall
admin chat

i know i have more but just cant think of em



Thanks a lot Those are some nice suggestions, especially admin chat Also, of course I am updating the version for ideas like these are always welcome

EDIT- The /say command is already an admin chat. I will add those 2 commands later today!!!
Reply
#36

Oh since your updating it i have 1 more suggestion for you to add:
/setint <playerid> <int> = sets a players interior
/setintall <int>

and all the skins arent available with the /setskin. some of the working skins say crashable skin... on mine i fixed this but it would be good for other ppl too
Reply
#37

Thanks for your contribution, during the update I\'ll look at the general reference again for all usable skin ids.
Reply
#38

a /setcolor or /setallcolor command would own! You could invent custom ingame minigames if you had it, "kill the blue one" lol
Reply
#39

Quote:
Originally Posted by traxxus
looks good, but i think they are too many for 1 page. delete some cars and look.
AHH!!! i uderstand
how can i make /giveme2
Reply
#40

/GIVEME2 COMMAND NOT WORKING!

can somebody help me... i can't find the problem

i change:

Commands.ini:
Код:
morning=1
afternoon=1
evening=1
midnight=1
settime=1
goto=5
gethere=8
announce=3
say=1
flip=1
slap=6
wire=8
unwire=5
kick=6
ban=9
akill=7
eject=6
freeze=8
unfreeze=6
outside=8
healall=5
uconfig=1
setsm=3
givehealth=6
sethealth=6
skinall=9
giveallweapon=7
resetallweapons=10
setcash=7
givecash=7
remcash=7
resetcash=7
setallcash=10
giveallcash=10
remallcash=10
resetallcash=10
ejectall=8
freezeall=10
unfreezeall=10
giveweapon=4
god=10
resetscores=7
setlevel=10
setskin=7
givearmour=5
setarmour=5
armourall=5
setammo=5
setscore=8
ip=1
ping=1
explode=5
setalltime=10
force=4
setallworld=5
setworld=2
setgravity=4
setwanted=6
setallwanted=7
xlock=1
xunlock=1
carcolor=1
gmx=10
carhealth=5
weather=4
setping=5
giveme=6
giveme2=6
givecar=7
spec=4
xjail=7
xunjail=3
setname=4
xspec=4
vr=0
Filterscript:
Код:
static VehicleLockData[MAX_VEHICLES] = false, Menu:GiveMe, Menu:GiveMe2, Menu:GiveCar, Menu:Weather,ServerWeather = 0; forward PingKick();
Код:
	CreateCommandConfigEx(
		"xlock",1,"xunlock",1,"carcolor",1,"gmx",10,"carhealth",5,"setping",5,
		"giveme",6,"giveme2",6,"givecar",7,"xspec",4,"xjail",7,"xunjail",3,"vr",0,"weather",5
	);
i Add this:

Код:
		// Giveme Menu2
	GiveMe2 = CreateMenu("~g~Dennie's ~w~Car Select 2",1,125,150,300);
  if(IsValidMenu(GiveMe2)) {
		SetMenuColumnHeader(GiveMe2, 0, "Select a car to give yourself:");
		AddMenuItem(GiveMe2,0,"DFT-30");
		AddMenuItem(GiveMe2,0,"Utility Van");
		AddMenuItem(GiveMe2,0,"Muletto");
	}
DCMD COMMANDS LIST:

Код:
....dcmd(giveme,6,cmdtext);
	dcmd(giveme2,6,cmdtext);
	dcmd(givecar,7,cmdtext); ... ect.
i add :
Код:
dcmd_giveme2(playerid,params[]) {
  #pragma unused params
  //if(playerid,"giveme") {
    if(Spec[playerid][Spectating]) return SendClientMessage(playerid,red,"ERROR: You must not be spectating.");
    if(!IsPlayerInAnyVehicle(playerid)) {
    	TogglePlayerControllable(playerid,false);
    	SetCameraBehindPlayer(playerid);
    	return ShowMenuForPlayer(GiveMe2,playerid);
    } else return SendClientMessage(playerid,red,"ERROR: You can not be in a vehicle.");
  // } //else return SendLevelErrorMessage(playerid,"giveme");
}
i change:
Код:
dcmd_xcommands(playerid,params[]) {
  #pragma unused params
	if(!IsPlayerXAdmin(playerid)) return SendClientMessage(playerid,red,"ERROR: You must be an administrator to view these commands.");
	SendClientMessage(playerid,yellow,"morning,afternoon,evening,midnight,settime,goto,gethere,announce,say,flip,slap,(un)wire,kick,ban");
	SendClientMessage(playerid,yellow,"akill,eject(all),(un)freeze(all),outside,healall,uconfig,setsm,givehealth,sethealth,skinall,armourall");
	SendClientMessage(playerid,yellow,"resetallweapons,set/give/rem/reset(all)cash,god,resetscores,setlevel,setskin,givearmour,setarmour");
	SendClientMessage(playerid,yellow,"setammo,setscore,ip,ping,explode,setname,setalltime,force,set(all)world,setgravity,set(all)wanted");
	return SendClientMessage(playerid,yellow,"carcolor,give(all)weapon,x(unlock),gmx,carhealth,setping,giveme,giveme2,givecar,xspec,xcommands,weather");
}
Menu's:
Код:
public OnPlayerSelectedMenuRow(playerid, row) {
 	new Menu:Current = GetPlayerMenu(playerid);
 	if(Current == GiveMe) {
		new car[20],Float:X,Float:Y,Float:Z,Float:Angle,id,carid;
		GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle);
	  switch(row) {
	   case 0: car = "Infernus", id = 411;
	   case 1: car = "NRG500", id = 522;
	   case 2: car = "Monster Truck", id = 444;
	   case 3: car = "Packer", id = 443;
	   case 4: car = "RC Car", id = 441;
	   case 5: car = "Rancher", id = 489;
	   case 6: car = "Roadtrain", id = 515;
	   case 7: car = "Dumper", id = 406;
	   case 8: car = "Sultan", id = 560;
	   case 9: car = "Maverick", id = 487;
	   case 10: car = "Vortex", id = 539;
	   case 11: car = "Hydra", id = 520;
   	 case 12: car = "DFT-30", id = 578;
	   case 13: car = "Utility Van", id = 552;
	   case 14: car = "Muletto", id = 530;
	  }
	  SendCommandMessageToAdmins(playerid,"GIVEME");
	  new string[256]; format(string,sizeof(string),"You have selected \'%s\'.",car); SendClientMessage(playerid,yellow,string);
		carid = CreateVehicle(id,X,Y,Z,Angle,-1,-1,50000);
		PutPlayerInVehicle(playerid,carid,0);
		TogglePlayerControllable(playerid,true);
		if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
		SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
	}
	
		if(Current == GiveMe2) {
		new car[20],Float:X,Float:Y,Float:Z,Float:Angle,id,carid;
		GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle);
	  switch(row) {
   	 case 0: car = "DFT-30", id = 578;
	   case 1: car = "Utility Van", id = 552;
	   case 2: car = "Muletto", id = 530;
	  }
	  SendCommandMessageToAdmins(playerid,"GIVEME 2");
	  new string[256]; format(string,sizeof(string),"You have selected \'%s\'.",car); SendClientMessage(playerid,yellow,string);
		carid = CreateVehicle(id,X,Y,Z,Angle,-1,-1,50000);
		PutPlayerInVehicle(playerid,carid,0);
		TogglePlayerControllable(playerid,true);
		if(GetPlayerInterior(playerid)) LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
		SetVehicleVirtualWorld(carid,GetPlayerVirtualWorld(playerid));
	}
	... ECT..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)