About SetPlayerDrunkLevel !
#2

It's because you never specified DrunkLevel to take the value of a parameter.
So DrunkLevel was always 0.
pawn Код:
CMD:drunk(playerid, params[])
{
    if(pInfo[playerid][pAdminLevel] < 1 ) return 0;
    if( GetPlayerVirtualWorld( playerid ) != 0 ) return SendClientMessage( playerid, COLOR_RED, "[ ! ] You can't use Admin Commands in Virtual World !" );
    new giveplayerid,DrunkLevel;
    if(sscanf(params,"ui",giveplayerid,DrunkLevel)) return SendClientMessage(playerid, COLOR_RED1, "[ ! ] USAGE: /drunk <playerid> <drunklevel>");
    if( DrunkLevel < 2000 || DrunkLevel > 50000 ) return SendClientMessage( playerid, COLOR_RED, "[ ! ] Invalid Drunk Level (2000-50000)." );
    SetPlayerDrunkLevel(giveplayerid, DrunkLevel);
    SendClientMessage(giveplayerid, COLOR_RED1, "[ ! ] Your Drunk Level has been set to %d by an Admin");
    return 1;
}
EDIT: I fixed the command up a bit more. People with admin level of 2+ will not be able to use it. I made it so people with admin level of 0 will not be able to use it. Also;
pawn Код:
if( DrunkLevel < 2000 || DrunkLevel > 50000 ) return SendClientMessage( playerid, COLOR_RED, "[ ! ] Invalid Drunk Level (2000-50000)." );
Should be before:
pawn Код:
SetPlayerDrunkLevel(giveplayerid, DrunkLevel);

EDIT2: Also, you were storing the 'PlayerId/PartOfName' passed as a parameter into 'playerid' instead of 'giveplayerid'.
Reply


Messages In This Thread
About SetPlayerDrunkLevel ! - by MAFIAWARS - 04.10.2013, 18:25
Re: About SetPlayerDrunkLevel ! - by EiresJason - 04.10.2013, 18:31
Re: About SetPlayerDrunkLevel ! - by MAFIAWARS - 04.10.2013, 18:39
Re: About SetPlayerDrunkLevel ! - by iZN - 04.10.2013, 18:45
Re: About SetPlayerDrunkLevel ! - by MAFIAWARS - 04.10.2013, 18:47
Re: About SetPlayerDrunkLevel ! - by EiresJason - 04.10.2013, 18:53
Re: About SetPlayerDrunkLevel ! - by MAFIAWARS - 04.10.2013, 18:57
Re: About SetPlayerDrunkLevel ! - by EiresJason - 04.10.2013, 18:59
Re: About SetPlayerDrunkLevel ! - by MAFIAWARS - 04.10.2013, 19:24
Re: About SetPlayerDrunkLevel ! - by EiresJason - 04.10.2013, 19:32

Forum Jump:


Users browsing this thread: 2 Guest(s)