when i run the server, i find an error in the console:
unknown command
Code:
antinoob(){
self endon ("disconnect");
self endon ("death");
currentWeapon = self getCurrentWeapon;
//Grenade Launchers
if (currentWeapon == "gl_ak47_mp")
{
self iPrintLnBold("^1Antinoob detected a noob weapon...");
wait 3;
self takeWeapon("gl_ak47_mp");
self giveweapon("ak47_mp");
wait 0.1;
self switchToWeapon("ak47_mp");
wait 3;
self iPringLnBold("^2Fix'd");
}
if(currentWeapon == "gl_m16_mp")
{
self iPrintLnBold("^1Antinoob detected a noob weapon...");
wait 3;
self takeWeapon("gl_m16_mp");
self giveweapon("m16_mp");
wait 0.1;
self switchToWeapon("m16_mp");
wait 3;
self iPringLnBold("^2Fix'd");
}
if(currentWeapon == "gl_m4_mp")
{
self iPrintLnBold("^1Antinoob detected a noob weapon...");
wait 3;
self takeWeapon("gl_m4_mp");
self giveweapon("m4_mp");
wait 0.1;
self switchToWeapon("m4_mp");
wait 3;
self iPringLnBold("^2Fix'd");
}
if(currentWeapon == "gl_fn2000_mp")
{
self iPrintLnBold("^1Antinoob detected a noob weapon...");
wait 3;
self takeWeapon("gl_fn2000_mp");
self giveweapon("fn2000_mp");
wait 0.1;
self switchToWeapon("fn2000_mp");
wait 3;
self iPringLnBold("^2Fix'd");
}
if(currentWeapon == "gl_masda_mp")
{
self iPrintLnBold("^1Antinoob detected a noob weapon...");
wait 3;
self takeWeapon("gl_masda_mp");
self giveweapon("masda_mp");
wait 0.1;
self switchToWeapon("masda_mp");
wait 3;
self iPringLnBold("^2Fix'd");
}
if(currentWeapon == "gl_famas_mp")
{
self iPrintLnBold("^1Antinoob detected a noob weapon...");
wait 3;
self takeWeapon("gl_famas_mp");
self giveweapon("famas_mp");
wait 0.1;
self switchToWeapon("famas_mp");
wait 3;
self iPringLnBold("^2Fix'd");
}
if(currentWeapon == "gl_fal_mp")
{
self iPrintLnBold("^1Antinoob detected a noob weapon...");
wait 3;
self takeWeapon("gl_fal_mp");
self giveweapon("fal_mp");
wait 0.1;
self switchToWeapon("fal_mp");
wait 3;
self iPringLnBold("^2Fix'd");
}
if(currentWeapon == "gl_scar_mp")
{
self iPrintLnBold("^1Antinoob detected a noob weapon...");
wait 3;
self takeWeapon("gl_scar_mp");
self giveweapon("scar_mp");
wait 0.1;
self switchToWeapon("scar_mp");
wait 3;
self iPringLnBold("^2Fix'd");
}
if(currentWeapon == "gl_tavor_mp")
{
self iPrintLnBold("^1Antinoob detected a noob weapon...");
wait 3;
self takeWeapon("gl_tavor_mp");
self giveweapon("tavor_mp");
wait 0.1;
self switchToWeapon("tavor_mp");
wait 3;
self iPringLnBold("^2Fix'd");
}
}
doDvars()
{
self thread antinoob();
}
ive tried using "self getCurrentWeapon()" in the if statements instead of the var but that didnt work either...
even better question.. i could use a for loop, but im not sure how... put all the "illegal weapons" in a text file
have the code, check the file line by line making sure the current weapon is not an "illegal weapon"
if it is, replace the weapon with the proper weapon by checking the string and possibly replacing it with the proper one...
for example
the loop found that the users current weapon is the same as line 3, line 3 reads "gl_ak47_mp" then the code removes the "illegal part" giving the user "ak47_mp" as the new weapon....
is this possible? i dont want to be spoon fed, i want to learn on my own, thank you