if (IsPlayerAdmin(playerid)) == if (PlayerInfo[playerid][Admin] >= 1)
procurado por IsPlayerAdmin em seu comando e troca pela variavel de ADMIN como EX: pawn Код:
|
public OnPlayerCommandText ( playerid , cmdtext [ ] ) { new cmd [ 256 ] , idx , tmp [ 256 ] , giveplayerid; cmd = strtok ( cmdtext , idx ); tmp = strtok ( cmdtext , idx ); if ( strcmp ( cmd , "/proteger" , true,6 ) { if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][Admin] < 5) } SendClientMessage ( playerid , 0xFF0000FF , "Use: '/proteger [playerid]'." ) return 1; } giveplayerid = strval ( tmp ); if ( ! IsPlayerConnected ( playerid ) ) { SendClientMessage ( playerid , 0xFF0000FF , "[ERRO]ID Invбlido." ); return 1; } Attackable [ giveplayerid ] = 0; format ( string , sizeof ( string ) , "* %s Estб protegido e nгo poderб ser atacado pelos Mнsseis." , GetName ( giveplayerid ) ); SendClientMessage ( playerid , 0x00FF00FF , string ); SendClientMessage ( giveplayerid , 0x00FF00FF , "* Vocк nгo pode ser atacado pelos Mнsseis." ); return 1; } if ( strcmp ( cmd , "/desproteger" , true ) == 0 && IsPlayerAdmin ( playerid ) ) { if ( ! strlen ( tmp ) ) { SendClientMessage ( playerid , 0xFF0000FF , "Use: '/desproteger [playerid]'." ); return 1; } giveplayerid = strval ( tmp ); if ( ! IsPlayerConnected ( playerid ) ) { SendClientMessage ( playerid , 0xFF0000FF , "[ERRO]ID Invбlido." ); return 1; } Attackable [ giveplayerid ] = 1; format ( string , sizeof ( string ) , "* %s Estб desprotegido dos Mнsseis." , GetName ( giveplayerid ) ); SendClientMessage ( playerid , 0xFF0000FF , string ); SendClientMessage ( giveplayerid , 0xFF0000FF , "* Vocк estб desprotegido dos Mнsseis." ); return 1; } return 0; } |
if(strcmp(cmd, "/evento", true)==(PlayerInfo[playerid][Admin] >= 1)) |
public OnPlayerCommandText ( playerid , cmdtext [ ] )
{
new cmd [ 256 ] , idx , tmp [ 256 ] , giveplayerid;
cmd = strtok ( cmdtext , idx );
tmp = strtok ( cmdtext , idx );
if ( strcmp ( cmd , "/proteger" , true,6 )
{
if(PlayerDados[playerid][Admin] =< 5)
}
SendClientMessage ( playerid , 0xFF0000FF , "Use: '/proteger [playerid]'." )
return 1;
}
giveplayerid = strval ( tmp );
if ( ! IsPlayerConnected ( playerid ) )
{
SendClientMessage ( playerid , 0xFF0000FF , "[ERRO]ID Invбlido." );
return 1;
}
Attackable [ giveplayerid ] = 0;
format ( string , sizeof ( string ) , "* %s Estб protegido e nгo poderб ser atacado pelos Mнsseis." , GetName ( giveplayerid ) );
SendClientMessage ( playerid , 0x00FF00FF , string );
SendClientMessage ( giveplayerid , 0x00FF00FF , "* Vocк nгo pode ser atacado pelos Mнsseis." );
return 1;
}
if ( strcmp ( cmd , "/desproteger" , true ) == 0 && PlayerDados[playerid][Admin] =< 5)
{
if ( ! strlen ( tmp ) )
{
SendClientMessage ( playerid , 0xFF0000FF , "Use: '/desproteger [playerid]'." );
return 1;
}
giveplayerid = strval ( tmp );
if ( ! IsPlayerConnected ( playerid ) )
{
SendClientMessage ( playerid , 0xFF0000FF , "[ERRO]ID Invбlido." );
return 1;
}
Attackable [ giveplayerid ] = 1;
format ( string , sizeof ( string ) , "* %s Estб desprotegido dos Mнsseis." , GetName ( giveplayerid ) );
SendClientMessage ( playerid , 0xFF0000FF , string );
SendClientMessage ( giveplayerid , 0xFF0000FF , "* Vocк estб desprotegido dos Mнsseis." );
return 1;
}
return 0;
}