[Ajuda] comando...
#1

galera comando abaixo ...quando eu prendo um player exemplo ID [ 1 ] prende eu eo id [ 1 ] por que isso? ele nгo prende sу o id 1 prende todos

pawn Код:
if(strcmp(cmd, "/prendert", true) ==0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
new tmp[256];
new plid;
new tempo;
new motivo;
new ID;
new msg1[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "| ERRO | Digite : /Prendert [id] [tempo] [motivo]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho,"| ERRO | Digite : /Prendert [id] [tempo] [motivo]");
return 1;
}
tempo = strval(tmp);
msg1 = strtok(cmdtext, idx);
if(!strlen(msg1)){
SendClientMessage(playerid, Vermelho,"| ERRO | Digite : /Prendert [id] [tempo] [motivo]");
return 1;
}
if(tempo > 1000000 || tempo < 1){
SendClientMessage(playerid, Vermelho,"| ERRO | Tempo de 1 hб 1000000!");
return 1;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "| ERRO | O jogador nгo estб conectado");
return 1;
}
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), P_CONTAS, pname);
format(string, sizeof(string), "| INFO | O administrador(a) %s prendeu o jogador %s Por %d minutos ( MOTIVO: %s ) ", pname ,aname ,tempo ,motivo);
SendClientMessageToAll(Vermelho,string);
GameTextForPlayer(playerid, "~w~ Preso", 5000, 6);
SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(plid, 6);
SetPlayerHealth(plid, 99999);
ResetPlayerWeapons(plid);
Cadeia[ID] = 1;
TempoCadeia[ID] = tempo*60;
return 1;
}
Reply
#2

tenta ae

pawn Код:
if(strcmp(cmd, "/prendert", true) ==0) {
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), P_CONTAS, aname);
    new tmp[256];
    new plid;
    new tempo;
    new motivo;
    new msg1[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)){
        SendClientMessage(playerid, Vermelho, "| ERRO | Digite : /Prendert [id] [tempo] [motivo]");
        return 1;
    }
    plid = strval(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)){
        SendClientMessage(playerid, Vermelho,"| ERRO | Digite : /Prendert [id] [tempo] [motivo]");
        return 1;
    }
    tempo = strval(tmp);
    msg1 = strtok(cmdtext, idx);
    if(!strlen(msg1)){
        SendClientMessage(playerid, Vermelho,"| ERRO | Digite : /Prendert [id] [tempo] [motivo]");
        return 1;
    }
    if(tempo > 1000000 || tempo < 1){
        SendClientMessage(playerid, Vermelho,"| ERRO | Tempo de 1 hб 1000000!");
        return 1;
    }
    if(!IsPlayerConnected(plid)){
        SendClientMessage(playerid, Vermelho, "| ERRO | O jogador nгo estб conectado");
        return 1;
    }
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(plid, pname, MAX_PLAYER_NAME);
    format(file2, sizeof(file2), P_CONTAS, pname);
    format(string, sizeof(string), "| INFO | O administrador(a) %s prendeu o jogador %s Por %d minutos ( MOTIVO: %s ) ", pname ,aname ,tempo ,motivo);
    SendClientMessageToAll(Vermelho,string);
    GameTextForPlayer(plid, "~w~ Preso", 5000, 6);
    SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
    SetPlayerInterior(plid, 6);
    SetPlayerHealth(plid, 99999);
    ResetPlayerWeapons(plid);
    Cadeia[plid] = 1;
    TempoCadeia[plid] = tempo*60;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)