Jump to content
  • 0

Problema la sistem vip


Raphy

Question

9 answers to this question

Recommended Posts

CMD:setvip( playerid , params[ ] )
{
    //CheckVipLevel(playerid, 5);

	if( sscanf( params , "ui", params[ 0 ], params[ 1 ] ) )
		return SendClientMessage( playerid , 0xF60000AA , " Use /setvip [id] [level]" );

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

	new string[ 128 ];
	switch( params[ 1 ] )
	{
	    case 0:
	    {
	        GetPlayerVip( params[ 0 ] );
	        SendClientMessage( params[ 0 ] , 0xF60000AA , " From now you are not V.I.P. anymore " );
		}
	    case 1..4:
	    {
			SetPlayerVip( params[ 0 ], params[ 1 ] );
			format( string, 128, " Player set as V.I.P Level %d", params[ 1 ] );
			SendClientMessage( playerid , 0xF60000AA , string  );
			format( string, 128, " From now you are V.I.P. Level %d", params[ 1 ] );
			SendClientMessage( params[ 0 ] , 0xF60000AA , string );
		}
		default: return SendClientMessage( playerid , 0xF60000AA , " Use /setvip [id] [level]" );
	}
	pVipInfo[ params[ 0 ] ][ DisableVipChat ] = 0;
    pVipInfo[ params[ 0 ] ][ IgnoreGoto ] = 0;
    pVipInfo[ params[ 0 ] ][ GodMode ] = 0;
    pVipInfo[ params[ 0 ] ][ SkinIDd ] = -1;
	return 1;
}

Aceasta este comanda

Link to comment
Share on other sites

Poftim;

CMD:setvip( playerid , params[ ] )
{
    //CheckVipLevel(playerid, 5);
      if(PlayerInfo[playerid][pAdmin] > 1337)
     {

       if( sscanf( params , "ui", params[ 0 ], params[ 1 ] ) )
		return SendClientMessage( playerid , 0xF60000AA , " Use /setvip [id] [level]" );

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

	new string[ 128 ];
	switch( params[ 1 ] )
	{
	    case 0:
	    {
	        GetPlayerVip( params[ 0 ] );
	        SendClientMessage( params[ 0 ] , 0xF60000AA , " From now you are not V.I.P. anymore " );
		}
	    case 1..4:
	    {
			SetPlayerVip( params[ 0 ], params[ 1 ] );
			format( string, 128, " Player set as V.I.P Level %d", params[ 1 ] );
			SendClientMessage( playerid , 0xF60000AA , string  );
			format( string, 128, " From now you are V.I.P. Level %d", params[ 1 ] );
			SendClientMessage( params[ 0 ] , 0xF60000AA , string );
		}
		default: return SendClientMessage( playerid , 0xF60000AA , " Use /setvip [id] [level]" );
	}
	pVipInfo[ params[ 0 ] ][ DisableVipChat ] = 0;
    pVipInfo[ params[ 0 ] ][ IgnoreGoto ] = 0;
    pVipInfo[ params[ 0 ] ][ GodMode ] = 0;
    pVipInfo[ params[ 0 ] ][ SkinIDd ] = -1;
else
{
SendClientMessage(playerid, COLOR_WHITE, "Ne pare rau, dar nu ai acces la aceasta Comanda.");
}
}	
return 1;
}

<a href="http://www.userbars.be"><img src="http://img534.imageshack.us/img534/9098/36589.gif" alt="Free userbars" border="0"></a>

Link to comment
Share on other sites

Am bagat comanda si imi da urmatoarele erori:

F:\SA-MP Server\gamemodes\bare.pwn(4907) : error 017: undefined symbol "pAdmin"

F:\SA-MP Server\gamemodes\bare.pwn(4913) : warning 217: loose indentation

F:\SA-MP Server\gamemodes\bare.pwn(4938) : warning 217: loose indentation

F:\SA-MP Server\gamemodes\bare.pwn(4938) : error 029: invalid expression, assumed zero

F:\SA-MP Server\gamemodes\bare.pwn(4943) : warning 217: loose indentation

Linia 4907:

      if(PlayerInfo[playerid][pAdmin] > 1337)
Linia 4913:
	if( !IsPlayerConnected( params[ 0 ] ) )
Linia 4938:
else
Linia 4943:
return 1;

Te rog sa ma ajuti ca am incercat sa rezolv erorile dar nu am reusit.

Link to comment
Share on other sites

CMD:setwanted(playerid,params[]) {
	if(PlayerInfo[ playerid ][Level] >= 1) {
	    new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
	    if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setwanted [ playerid ] [level]");
		new player1 = strval(tmp), wanted = strval(tmp2), string[128];
//		if(wanted > 6) return SendClientMessage(playerid, red, "ERROR: Invaild wanted level");
		if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[ playerid ][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
			CMDMessageToAdmins(playerid,"SETWANTED");
			format(string, sizeof(string), "You have set \"%s's\" wanted level to '%d", pName(player1), wanted); SendClientMessage(playerid,blue,string);
			if(player1 != playerid) { format(string,sizeof(string),"{0049FF}Administrator {F81414}\"%s\" {FFFFFF}has set your wanted level to {6EF83C}'%d'", pName(playerid), wanted); SendClientMessage(player1,blue,string); }
   			return SetPlayerWantedLevel(player1, wanted);
	    } else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}

O comanda de admin simpla si am pus #pragma tabsize 0 la inceput si nu imi mai da acele warning imi da numai acele 2 erori.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.