Possible error with /impound Command.
#1

Hi Pro Scripters! xD

I hope someone here can help...

I am using the LSLRP Script. When I am a normal civillian and I type the /impound CMD It says You are not a cop!

But When I am a cop, and I do /Impound It says unknown command.

Below is the code, Can you spot anything that as wrong? Or does anyone have an Alternative piece of /impound code?

Код:
 
if(!strcmp(cmdtext,"/impound",true))
	{
	    if(!IsACop(playerid))return SendClientMessage(playerid,COLOR_WHITE,"You must be a cop to perform this");
	    if(!cmdtext[9])return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /Impound [playerid/name]");
	    new player=ReturnUser(cmdtext[9]);
	    if(!IsPlayerConnected(player))return SendClientMessage(playerid,COLOR_WHITE,"Player Not Found");
	    if(!IsPlayerInAnyVehicle(player))return SendClientMessage(playerid,COLOR_WHITE,"Player Is Not In A Vehicle");
	    new vehid=GetPlayerVehicleID(player);
	    new lights,alarm,doors,bonnet,boot,objective;
	    Impounded[vehid]=1;
	    GetVehicleParamsEx(vehid,lights,lights,alarm,doors,bonnet,boot,objective);
	    SetVehicleParamsEx(vehid,0,lights,alarm,doors,bonnet,boot,objective);
	    return SendClientMessage(playerid,COLOR_WHITE,"Vehicle has been booted!");
	}
Reply
#2

Quote:

return SendClientMessage(playerid,COLOR_WHITE,"Vehicle has been booted!");

The last line is wrong. 'cos it is "return SendClientMessage"
Try chanching that to SendClientMessage(playerid,COLOR_WHITE,"Vehicle has been booted!");. That should work. If it won't work, just make it 'SendClientMessage' without return and add 'return 1;' at the bottom (you also can get a warning if you don't add 'return 1;')

pawn Код:
SendClientMessage(playerid,COLOR_WHITE,"Vehicle has been booted!");
    return 1;
}
Reply
#3

^^ Your right but you could also type it wrong like this:
Well I read your message and you said you use /Impound command ...
Do you use "i" or do you use "I"?
Reply
#4

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
The last line is wrong. 'cos it is "return SendClientMessage"
Try chanching that to SendClientMessage(playerid,COLOR_WHITE,"Vehicle has been booted!");. That should work. If it won't work, just make it 'SendClientMessage' without return and add 'return 1;' at the bottom (you also can get a warning if you don't add 'return 1;')

pawn Код:
SendClientMessage(playerid,COLOR_WHITE,"Vehicle has been booted!");
    return 1;
}
Thanks very Much. Im testing this now.
Reply
#5

Quote:
Originally Posted by ToPhrESH
Посмотреть сообщение
^^ Your right but you could also type it wrong like this:
Well I read your message and you said you use /Impound command ...
Do you use "i" or do you use "I"?
No I use /impound
Reply
#6

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
The last line is wrong. 'cos it is "return SendClientMessage"
Try chanching that to SendClientMessage(playerid,COLOR_WHITE,"Vehicle has been booted!");. That should work. If it won't work, just make it 'SendClientMessage' without return and add 'return 1;' at the bottom (you also can get a warning if you don't add 'return 1;')

pawn Код:
SendClientMessage(playerid,COLOR_WHITE,"Vehicle has been booted!");
    return 1;
}
Nope. Its not working, Im still geting Unknown Server Command :/
Reply
#7

Quote:

No I use /impound

Quote:

if(!strcmp(cmdtext,"/impound",true))

Indeed. Uppercase's doesn't matter: It won't check for uppercase because "bool:ignorecase" = true.
Just try "/iMpOUnD" - It should work...

And ehm,
Was "Player" in any vehicle? - Wait I'll remake the code. Lemme try xD
Reply
#8

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
Indeed. Uppercase's doesn't matter: It won't check for uppercase because "bool:ignorecase" = true.
Just try "/iMpOUnD" - It should work...

And ehm,
Was "Player" in any vehicle? - Wait I'll remake the code. Lemme try xD
Okayy, Well My server doesnt have a dealership. It was deleted, But I can create them.
Reply
#9

pawn Код:
if(!strcmp(cmdtext, "/impound", true))
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You must be an cop!");
    if(!strlen(cmdtext[9])) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /inmpound [playerid]");
    if(!IsPlayerConnected(strval(cmdtext[9]))) return SendClientMessage(playerid, COLOR_WHITE, "That player is not connected or an invalid player ID!");
    if(!IsPlayerInAnyVehicle(strval(cmdtext[9]))) return SendClientMessage(playerid, COLOR_WHITE, "The player isn't in any vehicle!");
    Impounded[GetPlayerVehicleID(strval(cmdtext[9])) = 1;
    GetVehicleParamsEx(GetPlayerVehicleID(strval(cmdtext[9])), engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(GetPlayerVehicleID(strval(cmdtext[9])), 0, lights, alarm, doors, bonnet, boot, objective);
    SendClientMessage(playerid, COLOR_WHITE, "Vehicle has been booted!");
    return 1;
}
Try that. And also, I reccomend you using ZCMD+SSCANF. It's ALOT faster and params are easier to use.
Making the commands is also easier
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)