SA-MP Forums Archive
Possible error with /impound Command. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Possible error with /impound Command. (/showthread.php?tid=208699)



Possible error with /impound Command. - iiLiamii - 09.01.2011

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!");
	}



Re: Possible error with /impound Command. - Kwarde - 09.01.2011

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



Re: Possible error with /impound Command. - ToPhrESH - 09.01.2011

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


Re: Possible error with /impound Command. - iiLiamii - 09.01.2011

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.


Re: Possible error with /impound Command. - iiLiamii - 09.01.2011

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


Re: Possible error with /impound Command. - iiLiamii - 09.01.2011

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


Re: Possible error with /impound Command. - Kwarde - 09.01.2011

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


Re: Possible error with /impound Command. - iiLiamii - 09.01.2011

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.


Re: Possible error with /impound Command. - Kwarde - 09.01.2011

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