[Ajuda] Comando "bugado"
#1

Bom o comando /cv quando eu crio um veiculo ele tipo freeza o meu personagem e eu nгo consigo fazer mais nada no servidor, dai tenho que fechar...
Olhe como estб o comando.
pawn Код:
if(strcmp(cmd, "/cv", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
//new carro;
new Float:X,Float:Y,Float:Z,Float:Angle;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /cv [id-do-caro]");
return 1;
}
plid = strval(tmp);
if(plid==3 || plid==2 || plid==1 || plid==4 || plid==5 || plid==56 || plid==50 || plid==43 || plid==52 || plid==44|| plid==45 ){
SendClientMessage(playerid, Vermelho, "[SERVER] ID de carro Proibido!");
return 1;
}
if(IsPlayerConnected(playerid)){
if(plid >= 400 && plid <= 611){
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
new carro = CreateVehicle(plid, X, Y, Z, Angle, -1, -1, 120000);
PutPlayerInVehicle(playerid,carro,0);
if(GetPlayerInterior(playerid))
LinkVehicleToInterior(carro,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carro,GetPlayerVirtualWorld(playerid));
format(string, sizeof(string), "(INFO) Vocк criou o veнculo de id: %d", plid);
SendClientMessage(playerid, tcadm, string);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) ID invбlido || ID's = 400-611");
return 1;
}
}
}
}
Nгo sei oque estб acontencendo...
E quando eu entro em um veiculo sу as vezes ele freeza o meu personagem
alguem sabe oque й?
Reply
#2

Tenta isso!!

Код:
if(strcmp(cmd, "/cv", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
//new carro;
new Float:X,Float:Y,Float:Z,Float:Angle;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /cv [id-do-caro]");
return 1;
}
plid = strval(tmp);
if(plid==3 || plid==2 || plid==1 || plid==4 || plid==5 || plid==56 || plid==50 || plid==43 || plid==52 || plid==44|| plid==45 ){
SendClientMessage(playerid, Vermelho, "[SERVER] ID de carro Proibido!");
return 1;
}
if(IsPlayerConnected(playerid)){
if(plid >= 400 && plid <= 611){
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
new carro = CreateVehicle(plid, X, Y, Z, Angle, -1, -1, 120000);
if(GetPlayerInterior(playerid))
LinkVehicleToInterior(carro,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carro,GetPlayerVirtualWorld(playerid));
format(string, sizeof(string), "(INFO) Vocк criou o veнculo de id: %d", plid);
SendClientMessage(playerid, tcadm, string);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) ID invбlido || ID's = 400-611");
return 1;
}
}
}
}
Reply
#3

pawn Код:
if(strcmp(cmd, "/cv", true) == 0)
{
    if(pAdmin[playerid] > 2)
    {
        new plid , Float:X,Float:Y,Float:Z,Float:Angle;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /cv [id-do-caro]");
        plid = strval(tmp);
        if(plid >= 400 && plid <= 611)
        {
            GetPlayerPos(playerid,X,Y,Z);
            GetPlayerFacingAngle(playerid,Angle);
            new carro = CreateVehicle(plid, X, Y, Z, Angle, -1, -1, 120000);
            PutPlayerInVehicle(playerid,carro,0);
            if(GetPlayerInterior(playerid))
            LinkVehicleToInterior(carro,GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(carro,GetPlayerVirtualWorld(playerid));
            format(string, sizeof(string), "(INFO) Vocк criou o veнculo de id: %d", plid);
            SendClientMessage(playerid, -1, string);
            TogglePlayerControllable(playerid, 1);
            return 1;
        }
            else    {
            SendClientMessage(playerid, Vermelho, "(ERRO) ID invбlido || ID's = 400-611");
            return 1;
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)