[Ajuda] Aparecer nome
#1

Como faзo para ao invйs de aparecer "Colocasse o capacete" aparecesse "Nome Do Player colocou o capacete"
pawn Код:
#include <a_samp>
//=====[Defines]======
#define SLOT 1
#define FILTERSCRIPT
//=======[Cores]======
#define Amarelo 0xFFFF00AA
#define Azul 0x2641FEAA
#define Vermelho 0xA10000AA
//=====[FORWARDS]=====
forward Tontura(playerid);
forward IsABike(vehicleid);
//======[News's]======
new CintoStatus[MAX_PLAYERS];
new CapaceteStatus[MAX_PLAYERS];
//=====[Defines]======

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n---------------------------------------------------------------");
    print(" Sistema de Cinto de Seguranзa e Capacete ligado");
    print("-----------------------------------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
        if(CintoStatus[playerid] == 0)
        {
        new Float:VIDA;
        GetPlayerHealth(playerid, VIDA);
        SetPlayerHealth(playerid, VIDA-5.0);
        SetTimer("Tontura",1,0);
        SetPlayerDrunkLevel(playerid, 5);
        }
        return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{

    if (strcmp("/capacete", cmdtext, true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsABike(GetPlayerVehicleID(playerid)))
            {
                if(CapaceteStatus[playerid] == 0)
                {
                    SendClientMessage(playerid, Azul,"Colocasse o Capacete.");
                    CapaceteStatus[playerid] = 1;
                    switch(GetPlayerSkin(playerid))
                    {
                        #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
                        case 0, 65, 74, 149, 208, 273:  SPAO{0.070000, 0.000000, 0.000000, 88.000000, 75.000000, 0.000000}
                        case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 77.000000, 0.000000}
                        case 7, 10: SPAO{0.090000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
                        case 9: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
                        case 11..13: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
                        case 15: SPAO{0.059999, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 17..21: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 40: SPAO{0.050000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 51..54: SPAO{0.100000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 59..62: SPAO{0.079999, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 77: SPAO{0.059999, 0.019999, 0.000000, 87.000000, 82.000000, 0.000000}
                        case 85, 88, 89: SPAO{0.070000, 0.039999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 90..97: SPAO{0.050000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 132: SPAO{0.000000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 144..146: SPAO{0.090000, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 220: SPAO{0.029999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 223, 246: SPAO{0.070000, 0.050000, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 224..245: SPAO{0.070000, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 294: SPAO{0.070000, 0.019999, 0.000000, 91.000000, 84.000000, 0.000000}
                        case 295: SPAO{0.050000, 0.019998, 0.000000, 86.000000, 82.000000, 0.000000}
                        case 296..298: SPAO{0.064999, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 299: SPAO{0.064998, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                    }
                }
                else if(CapaceteStatus[playerid] == 1)
                {
                    SendClientMessage(playerid,Azul,"Trasse o Capacete.");
                    CapaceteStatus[playerid] = 0;
                    RemovePlayerAttachedObject(playerid, SLOT);
                }
            }
        }
        else
        {
            SendClientMessage(playerid,Amarelo,"[Erro] Nгo estбs em uma moto!");
        }
        return 1;
    }
    if (strcmp("/cinto", cmdtext, true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsABike(GetPlayerVehicleID(playerid)))
            {
                SendClientMessage(playerid,Amarelo, "[Erro] Nгo podes por o cinto em uma moto. (Digite /capacete)");
                return 1;
            }
            if(CintoStatus[playerid] == 0)
            {
                SendClientMessage(playerid,Azul,"Colocasse o Cinto de Seguranзa.");
                CintoStatus[playerid] = 1;
            }
            else if(CintoStatus[playerid] == 1)
            {
                SendClientMessage(playerid,Azul,"Tirasse o Cinto de Seguranзa.");
                CintoStatus[playerid] = 0;
            }
        }
        else
        {
            SendClientMessage(playerid,Amarelo,"[Erro] Nгo estбs num carro!");
        }
        return 1;
    }
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(CintoStatus[playerid] == 1)
    {
        SendClientMessage(playerid,Azul,"Tirasse o Cinto de Seguranзa.");
        CintoStatus[playerid] = 0;
    }
    if(CapaceteStatus[playerid] == 1)
    {
        SendClientMessage(playerid,Azul,"Colocasse o Capacete.");
        CapaceteStatus[playerid] = 0;
        RemovePlayerAttachedObject(playerid, SLOT);
    }
    return 1;
}

public IsABike(vehicleid)
{   new model = GetVehicleModel(vehicleid);
    if(model == 581 || model == 509 || model == 481 || model == 462 || model == 521 || model == 463 || model == 510 || model == 522 || model == 461 || model == 448 || model == 471 || model == 468 || model == 586)
    {
        return 1;
    }
    return 0;
}
#endif
//Fim do meu primeiro FilterScript :D
Reply
#2

sendername ?
Reply
#3

toma aki na boquinha BB

PHP код:
#include <a_samp>
//=====[Defines]======
#define SLOT 1
#define FILTERSCRIPT
//=======[Cores]======
#define Amarelo 0xFFFF00AA
#define Azul 0x2641FEAA
#define Vermelho 0xA10000AA
//=====[FORWARDS]=====
forward Tontura(playerid);
forward IsABike(vehicleid);
//======[News's]======
new CintoStatus[MAX_PLAYERS];
new 
CapaceteStatus[MAX_PLAYERS];
new 
sendername[MAX_PLAYER_NAME];
//=====[Defines]======
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print(
"\n---------------------------------------------------------------");
    print(
" Sistema de Cinto de Seguranзa e Capacete ligado");
    print(
"-----------------------------------------------------------------\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
OnVehicleDamageStatusUpdate(vehicleidplayerid)
{
        if(
CintoStatus[playerid] == 0)
        {
        new 
Float:VIDA;
        
GetPlayerHealth(playeridVIDA);
        
SetPlayerHealth(playeridVIDA-5.0);
        
SetTimer("Tontura",1,0);
        
SetPlayerDrunkLevel(playerid5);
        }
        return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/capacete"cmdtexttrue) == 0)
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            if(
IsABike(GetPlayerVehicleID(playerid)))
            {
                if(
CapaceteStatus[playerid] == 0)
                {
                    
SendClientMessage(playeridAzul,"Player %s Colocou seu Capacete."sendername);
                    
CapaceteStatus[playerid] = 1;
                    switch(
GetPlayerSkin(playerid))
                    {
                        
#define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
                        
case 06574149208273:  SPAO{0.0700000.0000000.00000088.00000075.0000000.000000}
                        case 
1..6814162227293341..4982..848687119289SPAO{0.0700000.0000000.00000088.00000077.0000000.000000}
                        case 
710SPAO{0.0900000.0199990.00000088.00000090.0000000.000000}
                        case 
9SPAO{0.0599990.0199990.00000088.00000090.0000000.000000}
                        case 
11..13SPAO{0.0700000.0199990.00000088.00000090.0000000.000000}
                        case 
15SPAO{0.0599990.0000000.00000088.00000082.0000000.000000}
                        case 
17..21SPAO{0.0599990.0199990.00000088.00000082.0000000.000000}
                        case 
23..262830..3234..3957589899104..118120..131SPAO{0.0799990.0199990.00000088.00000082.0000000.000000}
                        case 
40SPAO{0.0500000.0099990.00000088.00000082.0000000.000000}
                        case 
50100..103148150..189222SPAO{0.0700000.0099990.00000088.00000082.0000000.000000}
                        case 
51..54SPAO{0.1000000.0099990.00000088.00000082.0000000.000000}
                        case 
5556636466..73757678..81133..143147190..207209..219221247..272274..288290..293SPAO{0.0700000.0199990.00000088.00000082.0000000.000000}
                        case 
59..62SPAO{0.0799990.0299990.00000088.00000082.0000000.000000}
                        case 
77SPAO{0.0599990.0199990.00000087.00000082.0000000.000000}
                        case 
858889SPAO{0.0700000.0399990.00000088.00000082.0000000.000000}
                        case 
90..97SPAO{0.0500000.0199990.00000088.00000082.0000000.000000}
                        case 
132SPAO{0.0000000.0199990.00000088.00000082.0000000.000000}
                        case 
144..146SPAO{0.0900000.0000000.00000088.00000082.0000000.000000}
                        case 
220SPAO{0.0299990.0199990.00000088.00000082.0000000.000000}
                        case 
223246SPAO{0.0700000.0500000.00000088.00000082.0000000.000000}
                        case 
224..245SPAO{0.0700000.0299990.00000088.00000082.0000000.000000}
                        case 
294SPAO{0.0700000.0199990.00000091.00000084.0000000.000000}
                        case 
295SPAO{0.0500000.0199980.00000086.00000082.0000000.000000}
                        case 
296..298SPAO{0.0649990.0099990.00000088.00000082.0000000.000000}
                        case 
299SPAO{0.0649980.0199990.00000088.00000082.0000000.000000}
                    }
                }
                else if(
CapaceteStatus[playerid] == 1)
                {
                    
SendClientMessage(playerid,Azul,"Player %s retirou o Capacete!."sendername);
                    
CapaceteStatus[playerid] = 0;
                    
RemovePlayerAttachedObject(playeridSLOT);
                }
            }
        }
        else
        {
            
SendClientMessage(playerid,Amarelo,"[Erro] Nгo estбs em uma moto!");
        }
        return 
1;
    }
    if (
strcmp("/cinto"cmdtexttrue) == 0)
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            if(
IsABike(GetPlayerVehicleID(playerid)))
            {
                
SendClientMessage(playerid,Amarelo"[Erro] Nгo podes por o cinto em uma moto. (Digite /capacete)");
                return 
1;
            }
            if(
CintoStatus[playerid] == 0)
            {
                
SendClientMessage(playerid,Azul,"Player %s Colocou o cinto de Seguranзa!."sendername);
                
CintoStatus[playerid] = 1;
            }
            else if(
CintoStatus[playerid] == 1)
            {
                
SendClientMessage(playerid,Azul,"Player %s retirou o cinto de Seguranзa!."sendername);
                
CintoStatus[playerid] = 0;
            }
        }
        else
        {
            
SendClientMessage(playerid,Amarelo,"[Erro] Nгo estбs num carro!");
        }
        return 
1;
    }
    return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
CintoStatus[playerid] == 1)
    {
        
SendClientMessage(playerid,Azul,"Player %s retirou o cinto de Seguranзa!."sendername);
        
CintoStatus[playerid] = 0;
    }
    if(
CapaceteStatus[playerid] == 1)
    {
        
SendClientMessage(playerid,Azul,"Player %s Colocou seu Capacete."sendername);
        
CapaceteStatus[playerid] = 0;
        
RemovePlayerAttachedObject(playeridSLOT);
    }
    return 
1;
}
public 
IsABike(vehicleid)
{   new 
model GetVehicleModel(vehicleid);
    if(
model == 581 || model == 509 || model == 481 || model == 462 || model == 521 || model == 463 || model == 510 || model == 522 || model == 461 || model == 448 || model == 471 || model == 468 || model == 586)
    {
        return 
1;
    }
    return 
0;
}
#endif
//Fim do meu primeiro FilterScript :D 
Reply
#4

No topo
pawn Код:
new name[MAX_PLAYER_NAME];
No comando
pawn Код:
SendClientMessage(playerid, Azul,"%s Colocasse o Capacete.", name);
Reply
#5

Quote:
Originally Posted by Luucass
Посмотреть сообщение
No topo
pawn Код:
new name[MAX_PLAYER_NAME]
No comando
pawn Код:
SendClientMessage(playerid, Azul,"%s Colocasse o Capacete.", name);
Foi oq eu fiz '-'

E й new sendername[MAX_PLAYER_NAME]; se с vai dar indefinido simbolo
Reply
#6

Quote:
Originally Posted by ScriptGameS
Посмотреть сообщение
Foi oq eu fiz '-'

E й new sendername[MAX_PLAYER_NAME]; se с vai dar indefinido simbolo
se eu criei um new chamado nome ele nao vai da indefinido '-'
Reply
#7

Jб tentei colocar o "%s" na frente e n deu ¬¬ vc postou o que eu ja tinha feito.
Reply
#8

pawn Код:
#include <a_samp>
//=====[Defines]======
#define SLOT 1
#define FILTERSCRIPT
//=======[Cores]======
#define Amarelo 0xFFFF00AA
#define Azul 0x2641FEAA
#define Vermelho 0xA10000AA
//=====[FORWARDS]=====
forward Tontura(playerid);
forward IsABike(vehicleid);
//======[News's]======
new CintoStatus[MAX_PLAYERS];
new CapaceteStatus[MAX_PLAYERS];
//=====[Defines]======

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n---------------------------------------------------------------");
    print(" Sistema de Cinto de Seguranзa e Capacete ligado");
    print("-----------------------------------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
        if(CintoStatus[playerid] == 0)
        {
        new Float:VIDA;
        GetPlayerHealth(playerid, VIDA);
        SetPlayerHealth(playerid, VIDA-5.0);
        SetTimer("Tontura",1,0);
        SetPlayerDrunkLevel(playerid, 5);
        }
        return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{

    if (strcmp("/capacete", cmdtext, true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsABike(GetPlayerVehicleID(playerid)))
            {
                if(CapaceteStatus[playerid] == 0)
                {
                    SendClientMessage(playerid, Azul,"Colocasse o Capacete.");
                    CapaceteStatus[playerid] = 1;
                    switch(GetPlayerSkin(playerid))
                    {
                        #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
                        case 0, 65, 74, 149, 208, 273:  SPAO{0.070000, 0.000000, 0.000000, 88.000000, 75.000000, 0.000000}
                        case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 77.000000, 0.000000}
                        case 7, 10: SPAO{0.090000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
                        case 9: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
                        case 11..13: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
                        case 15: SPAO{0.059999, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 17..21: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 40: SPAO{0.050000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 51..54: SPAO{0.100000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 59..62: SPAO{0.079999, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 77: SPAO{0.059999, 0.019999, 0.000000, 87.000000, 82.000000, 0.000000}
                        case 85, 88, 89: SPAO{0.070000, 0.039999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 90..97: SPAO{0.050000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 132: SPAO{0.000000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 144..146: SPAO{0.090000, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 220: SPAO{0.029999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 223, 246: SPAO{0.070000, 0.050000, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 224..245: SPAO{0.070000, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 294: SPAO{0.070000, 0.019999, 0.000000, 91.000000, 84.000000, 0.000000}
                        case 295: SPAO{0.050000, 0.019998, 0.000000, 86.000000, 82.000000, 0.000000}
                        case 296..298: SPAO{0.064999, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 299: SPAO{0.064998, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                    }
                }
                else if(CapaceteStatus[playerid] == 1)
                {
                    SendClientMessage(playerid,Azul,"Trasse o Capacete.");
                    CapaceteStatus[playerid] = 0;
                    RemovePlayerAttachedObject(playerid, SLOT);
                }
            }
        }
        else
        {
            SendClientMessage(playerid,Amarelo,"[Erro] Nгo estбs em uma moto!");
        }
        return 1;
    }
    if (strcmp("/cinto", cmdtext, true) == 0)
    {
 
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsABike(GetPlayerVehicleID(playerid)))
            {
                SendClientMessage(playerid,Amarelo, "[Erro] Nгo podes por o cinto em uma moto. (Digite /capacete)");
                return 1;
            }
           new stringcinto[100],nomedojovem[MAX_PLAYER_NAME+1];
           GetPlayerName(playerid, nomedojovem, sizeof(nomedojovem));
            if(CintoStatus[playerid] == 0)
            {
               format(stringcinto, sizeof(stringcinto), "%s colocou o Cinto de Seguranзa.", nomedojovem);
                SendClientMessage(playerid,Azul,stringcinto);
                CintoStatus[playerid] = 1;
            }
            else if(CintoStatus[playerid] == 1)
            {
format(stringcinto, sizeof(stringcinto), "%s tirou o Cinto de Seguranзa.", nomedojovem);
                SendClientMessage(playerid,Azul,stringcinto);
                CintoStatus[playerid] = 0;
            }
        }
        else
        {
            SendClientMessage(playerid,Amarelo,"[Erro] Nгo estбs num carro!");
        }
        return 1;
    }
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new stringcinto[100],nomedojovem[MAX_PLAYER_NAME+1];
    GetPlayerName(playerid, nomedojovem, sizeof(nomedojovem));
    if(CintoStatus[playerid] == 1)
    {
        format(stringcinto, sizeof(stringcinto), "%s tirou o Cinto de Seguranзa.", nomedojovem);
        SendClientMessage(playerid,Azul,stringcinto);
        CintoStatus[playerid] = 0;
    }
    if(CapaceteStatus[playerid] == 1)
    {
       format(stringcinto, sizeof(stringcinto), "%s Colocou o Capacete.", nomedojovem);
        SendClientMessage(playerid,Azul,stringcinto");
        CapaceteStatus[playerid] = 0;

        RemovePlayerAttachedObject(playerid, SLOT);
    }
    return 1;
}

public IsABike(vehicleid)
{   new model = GetVehicleModel(vehicleid);
    if(model == 581 || model == 509 || model == 481 || model == 462 || model == 521 || model == 463 || model == 510 || model == 522 || model == 461 || model == 448 || model == 471 || model == 468 || model == 586)
    {
        return 1;
    }
    return 0;
}
#endif
//Fim do meu primeiro FilterScript :D
editei de novo porque postei sem editar.
Reply
#9

tenta esse codigo :
pawn Код:
#include <a_samp>
//=====[Defines]======
#define SLOT 1
#define FILTERSCRIPT
//=======[Cores]======
#define Amarelo 0xFFFF00AA
#define Azul 0x2641FEAA
#define Vermelho 0xA10000AA
//=====[FORWARDS]=====
forward Tontura(playerid);
forward IsABike(vehicleid);
//======[News's]======
new CintoStatus[MAX_PLAYERS];
new CapaceteStatus[MAX_PLAYERS];
//=====[Defines]======

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n---------------------------------------------------------------");
    print(" Sistema de Cinto de Seguranзa e Capacete ligado");
    print("-----------------------------------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
        if(CintoStatus[playerid] == 0)
        {
        new Float:VIDA;
        GetPlayerHealth(playerid, VIDA);
        SetPlayerHealth(playerid, VIDA-5.0);
        SetTimer("Tontura",1,0);
        SetPlayerDrunkLevel(playerid, 5);
        }
        return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{

    if (strcmp("/capacete", cmdtext, true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsABike(GetPlayerVehicleID(playerid)))
            {
                if(CapaceteStatus[playerid] == 0)
                {
                    new nome[MAX_PLAYER_NAME];
                    SendClientMessage(playerid, Azul,"%s Colocasse o Capacete.", nome);
                    CapaceteStatus[playerid] = 1;
                    switch(GetPlayerSkin(playerid))
                    {
                        #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, SLOT, 18645, 2, (%0), (%1), (%2), (%3), (%4), (%5));
                        case 0, 65, 74, 149, 208, 273:  SPAO{0.070000, 0.000000, 0.000000, 88.000000, 75.000000, 0.000000}
                        case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.000000, 0.000000, 88.000000, 77.000000, 0.000000}
                        case 7, 10: SPAO{0.090000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
                        case 9: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
                        case 11..13: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 90.000000, 0.000000}
                        case 15: SPAO{0.059999, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 17..21: SPAO{0.059999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 40: SPAO{0.050000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 51..54: SPAO{0.100000, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 59..62: SPAO{0.079999, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 77: SPAO{0.059999, 0.019999, 0.000000, 87.000000, 82.000000, 0.000000}
                        case 85, 88, 89: SPAO{0.070000, 0.039999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 90..97: SPAO{0.050000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 132: SPAO{0.000000, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 144..146: SPAO{0.090000, 0.000000, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 220: SPAO{0.029999, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 223, 246: SPAO{0.070000, 0.050000, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 224..245: SPAO{0.070000, 0.029999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 294: SPAO{0.070000, 0.019999, 0.000000, 91.000000, 84.000000, 0.000000}
                        case 295: SPAO{0.050000, 0.019998, 0.000000, 86.000000, 82.000000, 0.000000}
                        case 296..298: SPAO{0.064999, 0.009999, 0.000000, 88.000000, 82.000000, 0.000000}
                        case 299: SPAO{0.064998, 0.019999, 0.000000, 88.000000, 82.000000, 0.000000}
                    }
                }
                else if(CapaceteStatus[playerid] == 1)
                {
                    SendClientMessage(playerid,Azul,"Trasse o Capacete.");
                    CapaceteStatus[playerid] = 0;
                    RemovePlayerAttachedObject(playerid, SLOT);
                }
            }
        }
        else
        {
            SendClientMessage(playerid,Amarelo,"[Erro] Nгo estбs em uma moto!");
        }
        return 1;
    }
    if (strcmp("/cinto", cmdtext, true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsABike(GetPlayerVehicleID(playerid)))
            {
                SendClientMessage(playerid,Amarelo, "[Erro] Nгo podes por o cinto em uma moto. (Digite /capacete)");
                return 1;
            }
            if(CintoStatus[playerid] == 0)
            {
                SendClientMessage(playerid,Azul,"Colocasse o Cinto de Seguranзa.");
                CintoStatus[playerid] = 1;
            }
            else if(CintoStatus[playerid] == 1)
            {
                SendClientMessage(playerid,Azul,"Tirasse o Cinto de Seguranзa.");
                CintoStatus[playerid] = 0;
            }
        }
        else
        {
            SendClientMessage(playerid,Amarelo,"[Erro] Nгo estбs num carro!");
        }
        return 1;
    }
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(CintoStatus[playerid] == 1)
    {
        SendClientMessage(playerid,Azul,"Tirasse o Cinto de Seguranзa.");
        CintoStatus[playerid] = 0;
    }
    if(CapaceteStatus[playerid] == 1)
    {
        SendClientMessage(playerid,Azul,"Colocasse o Capacete.");
        CapaceteStatus[playerid] = 0;
        RemovePlayerAttachedObject(playerid, SLOT);
    }
    return 1;
}

public IsABike(vehicleid)
{   new model = GetVehicleModel(vehicleid);
    if(model == 581 || model == 509 || model == 481 || model == 462 || model == 521 || model == 463 || model == 510 || model == 522 || model == 461 || model == 448 || model == 471 || model == 468 || model == 586)
    {
        return 1;
    }
    return 0;
}
#endif
//Fim do meu primeiro FilterScript :D
ta ai o codigo todo , coloca e dps vem ver se funciona
Reply
#10

Parem de dar cуdigos na boca pra esse inъtil. Na moral.. O cara quer tudo pronto, nгo estuda nada..

Cansei de ver 30 tуpicos dele por dia aqui na Board.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)