SA-MP Forums Archive
Command not working . - 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: Command not working . (/showthread.php?tid=98178)



Command not working . - Takumi.WS - 19.09.2009

Hmm oke. i scripted this command :

Код:
if(strcmp(cmdtext, "/v get", true) == 0)
		{
		  if(IsPlayerConnected(playerid))
			{
			  new playername[MAX_PLAYER_NAME];
				GetPlayerName(playerid, playername, sizeof(playername));
				if(PlayerInfo[playerid][pCarKey] == 255)
				{
					SendClientMessage(playerid, COLOR_GREY, "You don't own a car to get it.");
					return 1;
				}
				if(PlayerInfo[playerid][pCarKey] != 255 && strcmp(playername, Cars[PlayerInfo[playerid][pCarKey]][cOwner], true) == 0)
				{
					new car = PlayerInfo[playerid][pCarKey];
					new Float:pX1,Float:pY1,Float:pZ1;
					GetPlayerPos(playerid,pX1,pY1,pZ1);
					SetVehiclePos(car, pX1, pY1, pZ1);
					GivePlayerRM(playerid,-1337);
					SendClientMessage(playerid, COLOR_GREEN, "TRUCK COMPANY : Here is your car, thank you sir !");
					PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					return 1;
				}
			}
			return 1;
		}
It was working, but not anymore, no idea why
Thanks !


Re: Command not working . - vection - 19.09.2009

i think u cant use space in command.
try to change the command.


Re: Command not working . - ded - 19.09.2009

Quote:
Originally Posted by vection
i think u cant use space in command.
try to change the command.
This ^


You can try like ... if you have lots of /v commands like "/v get" /v repair" etc. etc. you can use one command "/v" and script variables for them .. which would be the "get" and "repair" ,etc.


In other case you could remove the space.


Re: Command not working . - brett7 - 19.09.2009

first you dont need this: if(IsPlayerConnected(playerid))
because if there not connected how can they type the cmd?

secondly /v get looks a bit sketchy so use either dcmd or strtok


Re: Command not working . - ded - 19.09.2009

Quote:
Originally Posted by brett7
first you dont need this: if(IsPlayerConnected(playerid))
because if there not connected how can they type the cmd?

secondly /v get looks a bit sketchy so use either dcmd or strtok
... I would recommend using dcmd rather than strcmp but even then, he won't be able to use a space ..