[Ajuda] :) ajuda aqui fasendo favor
#1

eae, bom eu criei um comando ta muito zuado eu nгo sei arrumar quando eu digito /punir id tempo eo motivo aparece o tempo tem que se maior que 0 nгo tem como eu prender o ID do jogador e tbm n estб aparecendo o administrador... prendeu o jogador fulano tempo motivo....

pawn Код:
if(strcmp(cmd, "/punirr", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
return 1;
}

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 20) {SendClientMessage(playerid, Vermelho, "| ERRO | O Tempo nгo pode ser menor que 1 nem maior que 20 !"); return 1; }
tmp = strtok(cmdtext, idx);
{
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) {
idx++;
}
new Hour,Min,Sec;
gettime(Hour,Min,Sec);
SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(plid, 6);
SetPlayerHealth(plid, 99999);
ResetPlayerWeapons(plid);
dini_IntSet(file2, "Preso", 1);
SendClientMessageToAll(tcadm, string);
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
format(string,256,"| INFO | O administrador %s Prendeu o jogador %s Tempo %d :( Motivo: %s )", Hour,Min,Sec);
GameTextForPlayer(playerid,"~w~ PRESO", 2000, 1);
Preso[plid] = 1;
}
}else{
format(string, sizeof(string), " | ERRO | ID %d invбlido!", plid);
SendClientMessage(playerid, Vermelho, string);
}
}
return 1;
}
Reply
#2

pawn Код:
if(strcmp(cmd, "/punirr", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 20) {SendClientMessage(playerid, Vermelho, "| ERRO | O Tempo nгo pode ser menor que 1 nem maior que 20 !"); return 1; }
tmp = strtok(cmdtext, idx);{
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
  new length = strlen(cmdtext);
  while ((idx < length) && (cmdtext[idx] <= ' ')) {
    idx++;
    new Hour,Min,Sec;
    gettime(Hour,Min,Sec);
    SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
    SetPlayerInterior(plid, 6);
    SetPlayerHealth(plid, 99999);
    ResetPlayerWeapons(plid);
    dini_IntSet(file2, "Preso", 1);
    SendClientMessageToAll(tcadm, string);
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
      result[idx - offset] = cmdtext[idx];
      idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result)){
      format(string,256,"| INFO | O administrador %s Prendeu o jogador %s Tempo %d :( Motivo: %s )", Hour,Min,Sec);
      SendClientMessageToAll(-1,string);
      GameTextForPlayer(playerid,"~w~ PRESO", 2000, 1);
      Preso[plid] = 1;
    }
  }
}
else{
  format(string, sizeof(string), " | ERRO | ID %d invбlido!", plid);
  SendClientMessage(playerid, Vermelho, string);
}
return 1;

}
tenta ae.
Reply
#3

Quote:
Originally Posted by Cromado
Посмотреть сообщение
eae, bom eu criei um comando
Dъvido que foi vocк que fez o comando.
Reply
#4

entгo fica duvidando
Reply
#5

kkkkkkkkkkkkkk vocк que fez o comando?
O Cara baixa o GM BWE pra fazer um servidor RP kkkkkkkkkkkkkkkkkkkkkkkk...
Na boa eu ri muito disso,
Reply
#6

Quote:
Originally Posted by Blix
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/punirr", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 20) {SendClientMessage(playerid, Vermelho, "| ERRO | O Tempo nгo pode ser menor que 1 nem maior que 20 !"); return 1; }
tmp = strtok(cmdtext, idx);{
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
  new length = strlen(cmdtext);
  while ((idx < length) && (cmdtext[idx] <= ' ')) {
    idx++;
    new Hour,Min,Sec;
    gettime(Hour,Min,Sec);
    SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
    SetPlayerInterior(plid, 6);
    SetPlayerHealth(plid, 99999);
    ResetPlayerWeapons(plid);
    dini_IntSet(file2, "Preso", 1);
    SendClientMessageToAll(tcadm, string);
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
      result[idx - offset] = cmdtext[idx];
      idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result)){
      format(string,256,"| INFO | O administrador %s Prendeu o jogador %s Tempo %d :( Motivo: %s )", Hour,Min,Sec);
      SendClientMessageToAll(-1,string);
      GameTextForPlayer(playerid,"~w~ PRESO", 2000, 1);
      Preso[plid] = 1;
    }
  }
}
else{
  format(string, sizeof(string), " | ERRO | ID %d invбlido!", plid);
  SendClientMessage(playerid, Vermelho, string);
}
return 1;

}
tenta ae.
po man eu digito /punirr 0 5 teste e aparece
pawn Код:
SendClientMessage(playerid, Vermelho, "| ERRO | Digite: /punirr [id] [Tempo] [motivo]");
eu tirei um desses SendClientMessage so que dai nгo acontece nada '-'
Reply
#7

alguem ai consegue me ajudar
Reply
#8

po galera eu digito /punirr id 10 teste e e so fica aparecendo digite /ppunir id tempo motivo
Reply
#9

Primeiro aprenda a programar os bбsicos, sу depois й que TENTA fazer um comando, e nгo copia-lo...
Uma boa indentaзгo tambйm dava jeito...

Um comando do meu Sistema de Admin:

pawn Код:
CMD:aj(playerid, params[]) // AJ
{
    if(IsPlayerAdmin(playerid))
    {
        new id;
       
        if(checkaj[id] == 0)
        {
            new string[128];
            new string1[128];
            new reason[32];
            new nomeadmin[MAX_PLAYER_NAME];
            new nomeplayer[MAX_PLAYER_NAME];

            if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, INFO,"[ USO: ] /aj [playerid] [razгo]");
            if(!IsPlayerConnected(id)) return SendClientMessage(playerid, FAIL,"[ ERRO: ] O player nгo estб conectado.");
            GetPlayerName(playerid, nomeadmin, sizeof(nomeadmin));
            GetPlayerName(id, nomeplayer, sizeof(nomeplayer));
            format(string, sizeof(string), "Tu deste AJ ao jogador %s.", nomeplayer);
            format(string1, sizeof(string1), "Foste de Admin Jail pelo Administrador %s e perdeste 1000$. Razгo: %s", nomeadmin, reason);
            SendClientMessage(playerid, SUCESSO, string);
            SendClientMessage(id, INFO, string1);
            SetPlayerPos(id, 1232.4852,640.1943,0.4801);
            GivePlayerMoney(id, -1000);
            checkaj[playerid] = 1;
           
            printf("[ LOG ] O administrador %s deu AJ ao jogador %s. Razao: %s", nomeadmin, nomeplayer, reason);
        }
        else
        {
            new string[128];
            new string1[128];
            new reason[32];
            new nomeadmin[MAX_PLAYER_NAME];
            new nomeplayer[MAX_PLAYER_NAME];

            if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, INFO,"[ USO: ] /aj [playerid] [razгo]");
            if(!IsPlayerConnected(id)) return SendClientMessage(playerid, FAIL,"[ ERRO: ] O player nгo estб conectado.");
            GetPlayerName(playerid, nomeadmin, sizeof(nomeadmin));
            GetPlayerName(id, nomeplayer, sizeof(nomeplayer));
            format(string, sizeof(string), "Tu tiraste do AJ o jogador %s.", nomeplayer);
            format(string1, sizeof(string1), "O Administrador %s tirou-te do Admin Jail. Razгo: %s", nomeadmin, reason);
            SendClientMessage(playerid, SUCESSO, string);
            SendClientMessage(id, INFO, string1);
            SetPlayerPos(id, -1560.8135,535.6848,7.8362);
            checkaj[playerid] = 0;
           
            printf("[ LOG ] O administrador %s tirou do AJ o jogador %s. Razao: %s", nomeadmin, nomeplayer, reason);
        }
    }
    else
    {
        SendClientMessage(playerid, FAIL, "[ ERRO: ] Tu nгo йs Administrador.");
    }
    return 1;
}
Й sу adapta-lo como vocк quiser.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)