04.02.2012, 23:25
Vocк pode enviar o modelo do comando para a public atravйs de um parвmetro desta a fim de fazer comparaзхes entre ele e outros valores
:
Espero ter ajudado
.

pawn Код:
if(strcmp(x_nr,"comprar",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[!] /v comprar [MODEL]");
return 1;
}
new veh = strval(tmp);
if(GetPlayerMoney(playerid) < ObeterPv(veh)) return SCM(playerid, -1, "Dinheiro insuficiente.");
}
public ObeterPv(veh) {
if(veh == 401) return 42000;
else if(veh == 401) return 25000; //Observaзгo: Compare a condiзгo do if dessa linha com a do da linha de cima e veja se hб algo errado.
else if(veh == 402) return 75000;
else if(veh == 403) return 32000;
else if(veh == 404) return 19000;
else if(veh == 405) return 50000;
else return 0;
}
Espero ter ajudado
