checklicense cmd won't work D: || help please
#1

my cmd:

Код:
dcmd_checklic(playerid,params[])
{
	if(PlayerData[playerid][Team] == 1 || PlayerData[playerid][Team] == 2)
	{
	new opfer,string[128];//oname[MAX_PLAYER_NAME];
  if(sscanf(params,"u",opfer)) return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /checklic [playerid]");
	if (!IsPlayerConnected(opfer)) return SendClientMessage(playerid, COLOR_YELLOW, "Invalid ID!");
	//if(opfer == playerid) return SendClientMessage(playerid, COLOR_YELLOW, "You can't jail yourself!");
	GetPlayerName(opfer,opfername,sizeof(opfername));
	if (GetDistanceBetweenPlayers(playerid,opfer) < 20)
	{
		format(string,sizeof(string),"Officer %s checks %s ID Card",PlayerName(playerid),opfername);
	 	ProxDetector(20, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		checkplayer[opfer] = playerid+1;
  	return 1;
  	}
	else return SendClientMessage(playerid, COLOR_YELLOW, "Nobody in range!");
	}
  else return SendClientMessage(playerid, COLOR_RED, "ERROR: Government only!");
}
Код:
if(IsACopCar(vehicleid) && checkplayer[playerid] >= 1)
	{
     SendClientMessage(playerid,COLOR_LIGHTBLUE,"teil1");
	  new string[128];
	  GetPlayerName(playerid,opfername,sizeof(opfername));
	  if(PlayerData[playerid][License] == 1)
	  {
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"teil2");
	    format(string,sizeof(string),"[HQ] %s got a valid License",opfername);
	    SendClientMessage(checkplayer[playerid]-1,COLOR_LIGHTBLUE,string);
	    checkplayer[playerid] = false;
	    return 1;
		}
    else
		{
           SendClientMessage(playerid,COLOR_LIGHTBLUE,"teil3");
		  format(string,sizeof(string),"[HQ] %s has not got a valid License",opfername);
	    SendClientMessage(checkplayer[playerid]-1,COLOR_LIGHTBLUE,string);
	    checkplayer[playerid] = false;
	    return 1;
		}
	}
then code should work like this: the Cop typed /checklic [playerid] then he has to enter a Copcar and there it shows if the person, he checked for a license, has one.

now when i check myself the msgs test1, test2 shows up if i have a license, if i dont have one test3 shows up instead of test2

but when i check somebody other (not me) no msgs shows up

help me please
Reply
#2

i got a new code now but it only works when i check myself
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)