pawn Код:
dcmd_setmototaxi(playerid,params[])
{
if(Player[playerid][pAdmin] < 4 && Player[playerid][pMotoTaxi] < 3)
return SendClientMessage(playerid, COR_ERRO, "ERRO: Vocк nгo tem permissгo!");
new tmp[256],Index;
tmp = strtok(params,Index);
new id;
new tmp2[256]; tmp2 = strtok(params,Index);
if(!strlen(tmp)||!strlen(tmp2)||!IsNumeric(tmp2)||!(strval(tmp2) >= 0 && strval(tmp2) <= 3))
return SendClientMessage(playerid,AzulEscuro,"ERRO: /SetMotoTaxi |ID| |1 - 3|");
if(!IsNumeric(tmp))
id = ReturnPlayerID(tmp);
else
id = strval(tmp);
if(!IsPlayerConnected(id))
{
new file[256];
format(file,256,CONTAS,tmp);
if(DOF2_FileExists(file))
{
DOF2_SetInt(file,"MotoTaxi", strval(tmp2));
new string[128];
if(strval(tmp2) == 1) {
format(string, sizeof(string), "{6495ED}ADMCmd: Vocк setou a conta de %s para Moto Taxi.", tmp);
SendClientMessage(playerid, COR_PRINCIPAL,string);
format(string, 128,"{6495ED}ADMCmd: O %s %s setou %s de Moto Taxi.", AccountName(playerid), getPName(playerid), tmp);
SendMessageToAdminsEx(string);
format(string, sizeof(string), "%s setou %s de Moto Taxi.", getPName(playerid), tmp);
WriteLog("setMotoTaxi", string);
}
else {
format(string, sizeof(string), "{6495ED}ADMCmd: Vocк retirou o Moto Taxi da conta %s.", tmp);
SendClientMessage(playerid, COR_PRINCIPAL,string);
format(string, 128,"{6495ED}ADMCmd: O %s %s retirou o Moto Taxi de %s.", AccountName(playerid), getPName(playerid), tmp);
SendMessageToAdminsEx(string);
format(string, sizeof(string), "%s retirou o Moto Taxi de %s.", getPName(playerid), tmp);
WriteLog("setMotoTaxi", string);
}
return 1;
}
else
return SendClientMessage(playerid,COR_ERRO,"ERRO: Jogador nгo encontrado!");
}
else
{
if(Player[id][pLogged] == false)
return SendClientMessage(playerid,COR_ERRO,"ERRO: O jogador selecionado nгo estб logado.");
new string[128];
Player[id][pMotoTaxi] = strval(tmp2);
if(strval(tmp2) > 3 || strval(tmp2) < 0) return SendClientMessage(playerid, -1, "Niveis de 0 ate 3");
if(strval(tmp2) == 1) {
format(string, 128,"INFO» O %s %s Mudou seu level de Moto-Taxi para 1.",getPName(playerid));
SendClientMessage(id,COR_VERDECLARO,string);
format(string, 128,"LOG» Vocк setou %s (id: %d) deMoto-Taxi Level 1.",getPName(id), id);
SendClientMessage(playerid,COR_PRINCIPAL,string);
format(string, 128,"{00688B}LOG» O %s %s setou %s de Moto-Taxi Level 1.", getPName(playerid), getPName(id));
SendMessageToAdminsEx(string);
format(string, sizeof(string), "{00688B}%s setou %s de Moto-Taxi.", getPName(playerid), getPName(id));
WriteLog("setMotoTaxi", string);
}
if(strval(tmp2) == 2) {
format(string, 128,"INFO» O %s %s Mudou seu level de Moto-Taxi para 2.",getPName(playerid));
SendClientMessage(id,COR_VERDECLARO,string);
format(string, 128,"LOG» Vocк setou %s (id: %d) deMoto-Taxi Level 2.",getPName(id), id);
SendClientMessage(playerid,COR_PRINCIPAL,string);
format(string, 128,"{00688B}LOG» O %s %s setou %s de Moto-Taxi Level 2.", getPName(playerid), getPName(id));
SendMessageToAdminsEx(string);
format(string, sizeof(string), "{00688B}%s setou %s de Moto-Taxi.", getPName(playerid), getPName(id));
WriteLog("setMotoTaxi", string);
}
if(strval(tmp2) == 3) {
format(string, 128,"INFO» O %s %s Mudou seu level de Moto-Taxi para 3.",getPName(playerid));
SendClientMessage(id,COR_VERDECLARO,string);
format(string, 128,"LOG» Vocк setou %s (id: %d) deMoto-Taxi Level 3.",getPName(id), id);
SendClientMessage(playerid,COR_PRINCIPAL,string);
format(string, 128,"{00688B}LOG» O %s %s setou %s de Moto-Taxi Level 3.", getPName(playerid), getPName(id));
SendMessageToAdminsEx(string);
format(string, sizeof(string), "{00688B}%s setou %s de Moto-Taxi.", getPName(playerid), getPName(id));
WriteLog("setMotoTaxi", string);
}
if(strval(tmp2) == 0)
format(string, 128,"INFO» O %s %s Mudou seu level de Moto-Taxi para 0.",getPName(playerid));
SendClientMessage(id,COR_VERDECLARO,string);
format(string, 128,"LOG» Vocк retirou %s (id: %d) deMoto-Taxi Level 0.",getPName(id), id);
SendClientMessage(playerid,COR_PRINCIPAL,string);
format(string, 128,"{00688B}LOG» O %s %s retirou %s de Moto-Taxi Level 0.", getPName(playerid), getPName(id));
SendMessageToAdminsEx(string);
format(string, sizeof(string), "{00688B}%s retirou o %s de Moto-Taxi.", getPName(playerid), getPName(id));
WriteLog("setMotoTaxi", string);
}
SalvarPlayer(id);
}
return 1;
}