SA-MP Forums Archive
Get player drunk level - 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: Get player drunk level (/showthread.php?tid=107196)



Get player drunk level - gtapolicemods - 08.11.2009

This code compiles in my script but when i do the command it doesn't give me anything back. not even an unknowncommand


Код:
if(strcmp(cmd, "/getdrunklevel", true) == 0 || strcmp(cmd, "/gdl", true) == 0)
	{
 if(gteam[playerid]==Team_LSPD || gteam[playerid] ==Team_SFPD || gteam[playerid] ==Team_TASK || gteam[playerid] ==Team_SASP || gteam[playerid]==Team_ERPSS || gteam[playerid] ==Team_DCP || gteam[playerid] ==Team_DCPT || gteam[playerid]==Team_Army || gteam[playerid]==Team_ArmyMed || IsStaff_L2A(playerid)==1){

		new tmp[256];
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GREY, "USAGE: /fst [playerid]");
			return 1;
		}
		giveplayerid = strval(tmp);
		new Float:x, Float:y, Float:z;
		GetPlayerPos(playerid, x, y, z);
		  if(IsPlayerInRangeOfPoint(playerid, 8.0, x , y, z))
			{
   			if(GetPlayerDrunkLevel(giveplayerid) > 1 && GetPlayerDrunkLevel(giveplayerid) < 2999)
			  {
          format(erpstring, sizeof(erpstring), "(INFO) You have tested %s for Alcohol use.",giveplayer);
          	format(erpstring, sizeof(erpstring), "(DCPCOM) %s: field sobriety test on one %s - subject clear, over.", ServiceUnitIdentifier(playerid), giveplayer);
					SendMessageToLaw(erpstring);
			    SendClientMessage(giveplayerid, COLOR_YELLOW,"He is not drunk");
    			}
  			if(GetPlayerDrunkLevel(giveplayerid) > 3000 && GetPlayerDrunkLevel(giveplayerid) < 5000)
			  {
			    format(erpstring, sizeof(erpstring), "(INFO) You have tested %s for Alcohol use.",giveplayer);
   				format(erpstring, sizeof(erpstring), "(DCPCOM) %s: field sobriety test conducted on one %s - possible 10-55 intoxicated driver, over.", ServiceUnitIdentifier(playerid), giveplayer);
					SendMessageToLaw(erpstring);
			    SendClientMessage(giveplayerid, COLOR_YELLOW,"He is Drunk");
    			}
    			if(GetPlayerDrunkLevel(giveplayerid) > 3001 && GetPlayerDrunkLevel(giveplayerid) < 50000)
			  {
			    format(erpstring, sizeof(erpstring), "(INFO) You have tested %s For Alcohol use.",giveplayer, giveplayerid);
   				format(erpstring, sizeof(erpstring), "(DCPCOM) %s: field sobriety test conducted on one %s - possible 10-55 intoxicated driver (WASTED), over.", ServiceUnitIdentifier(playerid), giveplayer);
					SendMessageToLaw(erpstring);
			    SendClientMessage(giveplayerid, COLOR_YELLOW,"He is Really WASTED");
			  }
				return 1;
		}
		
	}else{
	SendClientMessage(playerid, COLOR_BRIGHTRED, "Suspect out of range.");
	}

}



Re: Get player drunk level - MenaceX^ - 08.11.2009

return 1;..