13.12.2016, 22:30
Bom o correto estб abaixo, porem se eu fosse vocк nгo fazia os comandos com comparador de strings, e sim com o processador e comandos zcmd, juntamente com sscanf bem mais fбcil.
Aproveita que estб no comeзo.
Aproveita que estб no comeзo.
PHP код:
#include <a_samp>
#define PROF_DESEMPREGADO 0
#define PROF_CARRO_FORTE 1
#define C_CarroForte 0x0080FFAA
new Profissao[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/transportes", true) == 0)
{
if(Profissao[playerid] != PROF_CARRO_FORTE) {
SendClientMessage (playerid, -1, " Vocк agora trabalha na transportadoras de valores!");
Profissao[playerid] = PROF_CARRO_FORTE;
SetPlayerColor(playerid, C_CarroForte);
}
return 1;
}
if(strcmp(cmdtext, "/equipar", true) == 0)
{
if(Profissao[playerid]!= PROF_CARRO_FORTE) return SendClientMessage (playerid, -1, "Vocк nгo tem permissгo!");
if(Profissao[playerid] == PROF_CARRO_FORTE) {
SendClientMessage (playerid, -1, "Vocк pegou seu equipamento de trabalho!");
}
return 1;
}
return 0;
}