SetPlayerDrunkLevel Problem
#1

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

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 :]
Reply
#3

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

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

Thanks that code worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)