SA-MP Forums Archive
SetPlayerDrunkLevel Problem - 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: SetPlayerDrunkLevel Problem (/showthread.php?tid=206657)



SetPlayerDrunkLevel Problem - Osviux - 04.01.2011

I made this code for drug using. I wanted that players would get drunk for using them but i got some errors.

Код:
   if(strcmp(cmdtext, "/naudoti", true)==0)
	{
    	if(playerDB[playerid][narkotikai]<1)
		{
			SendClientMessage(playerid, RED, "* Neturite narkotiku");
			return 1;
		}
		
    	ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
    	playerDB[playerid][narkotikai]-=1;
    	SendClientMessage(playerid,BLUE,"* Naudojate narkotikus");
    	SetPlayerHealth(playerid,100);
		new Float:drunk;
		GetPlayerDrunkLevel(playerid,drunk);
		if(drunk<48000) SetPlayerDrunkLevel(playerid,drunk+2000);
		return 1;
		}
Код:
C:\Users\Labas\Desktop\MPGC\gamemodes\MPG.pwn(3805) : warning 202: number of arguments does not match definition
C:\Users\Labas\Desktop\MPGC\gamemodes\MPG.pwn(3806) : warning 213: tag mismatch



Re: SetPlayerDrunkLevel Problem - Toreno - 04.01.2011

Try that one:
pawn Код:
if(strcmp(cmdtext, "/naudoti", true)==0)
    {
        if(playerDB[playerid][narkotikai]<1) return SendClientMessage(playerid, RED, "* Neturite narkotiku");
        ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
        playerDB[playerid][narkotikai]-=1;
        SendClientMessage(playerid,BLUE,"* Naudojate narkotikus");
        SetPlayerHealth(playerid,100);
        new drunk = GetPlayerDrunkLevel(playerid);
        if(drunk < 48000) SetPlayerDrunkLevel(playerid,drunk+2000);
        return 1;
    }
It should work :]


Re: SetPlayerDrunkLevel Problem - jameskmonger - 04.01.2011

1) You didn't get errors, you got warnings.
2) Does it work ingame?
3) What are lines 3805 and 3806?


Re: SetPlayerDrunkLevel Problem - Toreno - 04.01.2011

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
1) You didn't get errors, you got warnings.
2) Does it work ingame?
3) What are lines 3805 and 3806?
He did something wrong in his command, I fixed it.


Re: SetPlayerDrunkLevel Problem - Osviux - 04.01.2011

Thanks that code worked.