SetCoins
#1

What's wrong here?
( 2978 ) : warning 202: number of arguments does not match definition

Код:
CMD:setcoins( playerid,params[])
{
    if ( GetPVarInt( playerid, "AdminLevel" ) < 1 )
	    return SendClientMessage( playerid, -1, "You must be an "#AdminLevel1" to use this command");

	if ( sscanf( params, "ui", params[ 0 ], params[ 1 ] ))
	    return SendClientMessage( playerid, -1, ""COLOR_LIGHTBLUE"Usage:{FFFFFF} /setcoins <id/name> <coins> ");

    if ( !IsPlayerConnected( params[ 0 ] ) )
	    return SendClientMessage( playerid, -1, ""COLOR_RED"Player is not connected");

    if (GetPVarInt( playerid, "AdminLevel" ) < GetPVarInt( params[ 0 ], "AdminLevel" ) )
	    return SendClientMessage( playerid, -1, "You are not allowed to use this command on this admin."),SendClientMessage( playerid, -1, "That player is higher in grade than you.");

	SetPVarInt( playerid, "Coins"); //2978 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

	new String[ 245 ];
    format( String, sizeof String, "You set "COLOR_LIGHTBLUE"%s's{FFFFFF} coins to "COLOR_LIGHTBLUE"%d", pName(  params[ 0 ] ),params[ 1 ] );
    SendClientMessage( playerid, -1, String );
    format( String, sizeof String, ""COLOR_LIGHTBLUE"%s( %s ){FFFFFF} set your coins to "COLOR_LIGHTBLUE"%d",pName( playerid ), GetPlayerLevelName( playerid ), params[ 1 ] );
    SendClientMessage( params[ 0 ], -1, String );
	return 1;
}
Reply
#2

EDIT <Corrected below>
Reply
#3

Line 2978 is
Код:
SetPVarInt( playerid, "Coins");
Reply
#4

The format is wrong.
Look here for correct format: https://sampwiki.blast.hk/wiki/SetPVarInt

This should work I guess:

Код:
SetPVarInt( playerid, "Coins",params[ 1 ]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)