[pedido]/checarcinto & sistema de /capacete[ajuda]
#1

Ola, queria fazer pro sv do meu amigo um /checarcinto mais eu ja peguei titurias ai e nao consegui

vo passar o codigo do meu /cinto [gm BLS 2.0 NO BUGS] obs: sу para cop o /checarcinto

Quote:

if(!strcmp(cmdtext, "/cinto", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(CintoPlayer[playerid] == 0)
{
CintoPlayer[playerid] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_YELLOW,"[Cinto] Parabйns Vocк esta de Cinto, Agora Esta Protegido (/tirarcinto)");
format(string, sizeof(string), "%s coloca o cinto de seguranзa.", sendername);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW,"[Cinto] Vocк jб estб de cinto.");
}
}
else
{
SendClientMessage(playerid, COLOR_YELLOW,"[Cinto] Vocк nгo estб em um veнculo.");
}
return 1;
}

Agora o /capacete se poder quando bater com a moto perder vida [brigado]
se vc's poderem me ajudar iria ficar muito grato sou novo em pawn muito o brigado quem ajudo
Reply
#2

Checarcinto
pawn Код:
if(strcmp("/checarcinto", cmdtext, true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!IsACop(playerid))
            {
            SendClientMessage(playerid, COLOR_RED, "Vocк nгo й um oficial !");
            return 1;
            }
            giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) return SendClientMessage(playerid,-1,"[Digite] /checarcinto [playerid/Parte-do-Nick]");
        }
        if(giveplayerid != INVALID_PLAYER_ID)
        {
            if(CintoPlayer[giveplayerid] == 0)
            {
            SendClientMessage(playerid, COLOR_WHITE, "O motorista estб sem cinto.");
            }
            else if(CintoPlayer[giveplayerid] == 1)
            {
            SendClientMessage(playerid, COLOR_WHITE, "O motorista estб com cinto.");
            return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "O Jogador nгo й ativo ou nгo estб conectado.");
            return 1;
        }
        return 0;
    }
Reply
#3

pawn Код:
if(strcmp("/checarcinto", cmdtext, true)==0)
{
  if(CintoPlayer[playerid] == 0) return SendClientMessage(playerid, -1, "Vocк Nгo Estб  Cinto.");
  if(CintoPlayer[playerid] == 1) return SendClientMessage(playerid, -1, "Vocк Estб com Cinto.");
  return true;
}
Reply
#4

vai chegar o seu prуprio cinto jona? '-' eu acho que ele quer um que o Policial cheque o de outra pessoa.
Reply
#5

Foi sу um exemplo pra ele fazer ^^
Reply
#6

pawn Код:
if(!strcmp(cmdtext, "/cinto", true))
    {
        if(!IsPlayerInAnyVehicle(playerid))
            return SendClientMessage(playerid, COLOR_YELLOW,"[Cinto] Vocк nгo estб em um veнculo.");

        if(!CintoPlayer[playerid])
            return SendClientMessage(playerid, COLOR_YELLOW,"[Cinto] Vocк jб estб de cinto.");
           
        GetPlayerName(playerid, sendername, sizeof(sendername));
        SendClientMessage(playerid, COLOR_YELLOW,"[Cinto] Parabйns Vocк esta de Cinto, Agora Esta Protegido (/tirarcinto)");
        format(string, sizeof(string), "%s coloca o cinto de seguranзa.", sendername);
        ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
        CintoPlayer[playerid] = 1;
        return true;
    }
+rep.
Reply
#7

o /cinto dele ta pegando Jб o.O ele quer o /checarcinto = FAIL.
Reply
#8

pawn Код:
if(strcmp("/checarcinto",cmdtext,true) == 0)
{
 // Definiзгo para policial...
 {
  tmp = strtok(cmdtext,idx);
  if(!strlen(tmp)) return SendClientMessage(playerid, -1,"USE: /checarcinto [playerid]");
  new outro = strval(tmp);
  if (!ProxDetectorS(3.0, playerid, giveplayerid))
  {
  SendClientMessage(playerid, 0xFF0000AA,"Vocк nгo estб perto do player sua mula!");  
return 1;
}
    if(CintoPlayer[outro] == 1)
    {
        SendClientMessage(playerid, -1,"Este player estб usando cinto.");
        return 1;
    }else if(CintoPlayer[outro] == 0)
    {
        SendClientMessage(playerid, -1,"Este player estб sem cinto.");
        return 1;
    }
  }
Tente assim caso nгo dк me avisa, o meu bloco de notas nгo compila entгo nem testei :O
Reply
#9

pawn Код:
// TOPO
new bool:   CintoPlayer[MAX_PLAYERS];
////
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/botarcinto", cmdtext, true))
    {
        if(CintoPlayer[playerid]) return SendClientMessage(playerid, -1, "Vocк Estб com Cinto.");
        return true;
    }
    if(!strcmp("/tirarcinto", cmdtext, true))
    {
        if(!CintoPlayer[playerid]) return SendClientMessage(playerid, -1, "Vocк jб estб de cinto");
        CintoPlayer[playerid] = false;
        return true;
    }
    if(!strcmp("/estoudecinto", cmdtext, true))
    {
        if(!CintoPlayer[playerid])
            return SendClientMessage(playerid, -1, "Vocк nгo estб de cinto, digite /botarcinto");

        SendClientMessage(playerid, -1, "Vocк jб estб de cinto, digite /tirarcinto");
        return true;
    }
    return false;
}
PS: testado.

+Re.
Reply
#10

Nгo й isso que ele quer mano, Credo leia direito D:
e ainda fica pedindo rep, coitado --'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)