[AJUDA] Carros para uma pessoa
#1

pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate)
{
                if (newstate == PLAYER_STATE_DRIVER)
                {
                new vid = GetPlayerVehicleID(playerid);
                if ( vid==Luciano[0]||vid==Luciano[1]||vid==Luciano[2]||vid==Luciano[3]||vid==Luciano[4]||vid==Luciano[5]||vid==Luciano[6]||vid==Luciano[7]||vid==Luciano[8]||vid==Luciano[9]||vid==Luciano[10]||vid==Luciano[11]||vid==Luciano[12]||vid==Luciano[13]||vid==Luciano[14]||vid==Luciano[15]||vid==Luciano[16]||vid==Luciano[17])
                {
                static sName[11];
                GetPlayerName(playerid,sName,11);
                if(!strcmp(sName,"Luciano_Jr",true))    { }
                else
                {
                SendClientMessage (playerid,0xFF0000FF,"Vocк nгo й o Luciano_Jr!");
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
                }
                }
                }
                return 1;
}
O cmd estб certo?
Reply
#2

Eu faria assim:

pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid);
        if ( vid==Luciano[0] || vid==Luciano[1] || vid==Luciano[2] || vid==Luciano[3] || vid==Luciano[4] || vid==Luciano[5] || vid==Luciano[6] || vid==Luciano[7] ||
        vid==Luciano[8] || vid==Luciano[9] || vid==Luciano[10] || vid==Luciano[11] || vid==Luciano[12] || vid==Luciano[13] || vid==Luciano[14] || vid==Luciano[15] || vid==Luciano[16] || vid==Luciano[17])
        {
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
            if(strcmp(pname, "Luciano_Jr", true) == 0) return false;
            SendClientMessage (playerid,0xFF0000FF,"Vocк nгo й o Luciano_Jr!");
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, 1);
            return 1;
        }
        return 1;
    }

    return 1;
}
Reply
#3

Sim. Pois pelo que eu vejo vocк usou uma estrutura de controle vazia para poder usar uma else que caso seja diferente.
Reply
#4

pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate)
{
 if (newstate == PLAYER_STATE_DRIVER)
 {
    new vid = GetPlayerVehicleID(playerid);
    if(vid==Luciano[0]||vid==Luciano[1]||vid==Luciano[2]||vid==Luciano[3]||vid==Luciano[4]
    ||vid==Luciano[5]||vid==Luciano[6]||vid==Luciano[7]||vid==Luciano[8]||vid==Luciano[9]
    ||vid==Luciano[10]||vid==Luciano[11]||vid==Luciano[12]||vid==Luciano[13]||vid==Luciano[14]
    ||vid==Luciano[15]||vid==Luciano[16]||vid==Luciano[17])
    {
     static sName[11];
     GetPlayerName(playerid,sName,11);
     if(!strcmp(sName,"Luciano_Jr",true))
     {
      return 1;
     }
     else
     {
        SendClientMessage (playerid,0xFF0000FF,"Vocк nгo й o Luciano_Jr!");
        RemovePlayerFromVehicle(playerid);
        TogglePlayerControllable(playerid, 1);
        return 1;
     }
    return 1;
   }
  return 1;
 }
 return 1;
}
Tenta assim.
Reply
#5

Quote:
Originally Posted by Shickcard
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate)
{
 if (newstate == PLAYER_STATE_DRIVER)
 {
    new vid = GetPlayerVehicleID(playerid);
    if(vid==Luciano[0]||vid==Luciano[1]||vid==Luciano[2]||vid==Luciano[3]||vid==Luciano[4]
    ||vid==Luciano[5]||vid==Luciano[6]||vid==Luciano[7]||vid==Luciano[8]||vid==Luciano[9]
    ||vid==Luciano[10]||vid==Luciano[11]||vid==Luciano[12]||vid==Luciano[13]||vid==Luciano[14]
    ||vid==Luciano[15]||vid==Luciano[16]||vid==Luciano[17])
    {
     static sName[11];
     GetPlayerName(playerid,sName,11);
     if(!strcmp(sName,"Luciano_Jr",true))
     {
      return 1;
     }
     else
     {
        SendClientMessage (playerid,0xFF0000FF,"Vocк nгo й o Luciano_Jr!");
        RemovePlayerFromVehicle(playerid);
        TogglePlayerControllable(playerid, 1);
        return 1;
     }
    return 1;
   }
  return 1;
 }
 return 1;
}
Tenta assim.
Tб errado.
Reply
#6

Pra que tanta return? Vou editar aqui quando eu testar.
Reply
#7

pawn Код:
new Luciano[18];
                new vid;
                if (newstate == PLAYER_STATE_DRIVER)
                {
                if(vid==Luciano[0]||vid==Luciano[1]||vid==Luciano[2]||vid==Luciano[3]||vid==Luciano[4] ||
                vid==Luciano[5]||vid==Luciano[6]||vid==Luciano[7]||vid==Luciano[8]||vid==Luciano[9] ||
                vid==Luciano[10]||vid==Luciano[11]||vid==Luciano[12]||vid==Luciano[13]||vid==Luciano[14] ||
                vid==Luciano[15]||vid==Luciano[16]||vid==Luciano[17]) {
                static sName[11];
                GetPlayerName(playerid,sName,11);
                if(!strcmp(sName,"Luciano_Jr",true))    { }
                else
                {
                SendClientMessage (playerid,0xFF0000FF,"Vocк nгo й o Luciano_Jr!");
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
                return 1;
                }
                }
                }
                return 0;
}
pawn Код:
new Luciano[18];
                new vid;
                if (newstate == PLAYER_STATE_DRIVER)
                {
                if(vid==Luciano[0]||vid==Luciano[1]||vid==Luciano[2]||vid==Luciano[3]||vid==Luciano[4] ||
                vid==Luciano[5]||vid==Luciano[6]||vid==Luciano[7]||vid==Luciano[8]||vid==Luciano[9] ||
                vid==Luciano[10]||vid==Luciano[11]||vid==Luciano[12]||vid==Luciano[13]||vid==Luciano[14] ||
                vid==Luciano[15]||vid==Luciano[16]||vid==Luciano[17]) {
                static sName[11];
                GetPlayerName(playerid,sName,11);
                if(!strcmp(sName,"Luciano_Jr",true))    { }
                else
                {
                SendClientMessage (playerid,0xFF0000FF,"Vocк nгo й o Luciano_Jr!");
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
                }
                }
                }
                return 1;
}
tente 1 desses dois, ou os dois c nao pegar 1 ^^ pq nao tou em casa mais erro nao vai da !
Reply
#8

Aquele meu tб certo...
Reply
#9

pawn Код:
new Luciano[18];
                new vid;
                if (newstate == PLAYER_STATE_DRIVER)
                {
                for(new B; B<sizeof(Luciano); B++){
                if(vid==Luciano[B]) {
                static sName[11];
                GetPlayerName(playerid,sName,11);
                if(!strcmp(sName,"Luciano_Jr",true))    { }
                else
                {
                SendClientMessage (playerid,0xFF0000FF,"Vocк nгo й o Luciano_Jr!");
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
                }
                }
                }
                return 1;
}
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)