Command not working .
#1

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 !
Reply
#2

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

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.
Reply
#4

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
Reply
#5

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 ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)