new xoxotas;
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/vendercasa", cmdtext, true, 10) == 0)
{
if(xoxotas == 0)
{
//maluco nao vende
}
if(xoxotas == 1)
{
xoxotas = 0;
//maluco vende a casa
}
return 1;
}
if (strcmp("/venderempresa", cmdtext, true, 10) == 0)
{
if(xoxotas == 0)
{
//maluco nao vende
}
if(xoxotas == 2)
{
xoxotas = 0;
//maluco vende a casa
}
return 1;
}
if (strcmp("/vendercarro", cmdtext, true, 10) == 0)
{
if(xoxotas == 0)
{
//maluco nao vende
}
if(xoxotas == 3)
{
xoxotas = 0;
//maluco vende a casa
}
return 1;
}
return 0;
}
YCMD:autorizarvendas ( playerid, params [ ], help )
{
new
targetid,
int_option;
if ( sscanf ( params, "du", int_option, targetid ) )
return SendClientMessage ( playerid, -1, "Use: /autorizarvenda [1,2,3] [ID/NOME]" );
if ( 0 >= int_option > 3 )
return SendClientMessage ( playerid, -1, "Use somente opзхes 1 (casa), 2 (empresa) e 3 (carro)" );
else if ( !IsPlayerConnected ( targetid ) || targetid == INVALID_PLAYER_ID )
return SendClientMessage ( playerid, -1, "Jogador nгo conectado." );
switch ( int_option )
{
case 1: SendClientMessage ( targetid, -1, "Um administrador te autorizou a vender a casa." );
case 2: SendClientMessage ( targetid, -1, "Um administrador te autorizou a vender a empresa." );
case 3: SendClientMessage ( targetid, -1, "Um administrador te autorizou a vender o carro." );
}
autorizadoavender [ targetid ] = int_option;
return 1;
}
|
Olб, Lуs! Gostaria de saber como funciona essa optimizaзгo "if ( 0 > int_option > 3 )" ?
![]() |
|
Olб, Lуs! Gostaria de saber como funciona essa optimizaзгo "if ( 0 > int_option > 3 )" ?
![]() |