[Ajuda]Cinto
#1

Boas quanto um player nao tem sinto e bate ele fica atorduado mas eu meti o SetTimer a 12000 e mesmo assim a tontura nunca sai vejam la

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];
//=====[Defines]======
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print(
"\n-------------------------------------------------------------------");
    print(
" Cinto de Seguranзa e Capacete Filterscript criado por Ricardo_Jorge");
    print(
"---------------------------------------------------------------------\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
OnVehicleDamageStatusUpdate(vehicleidplayerid)
{
        if(
CintoStatus[playerid] == 0)
        {
        new 
Float:VIDA;
        
GetPlayerHealth(playeridVIDA);
        
SetPlayerHealth(playeridVIDA-20.0);
        
SetTimer("Tontura",12000,0);
        
SetPlayerDrunkLevel(playerid12000);
        }
        return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/capacete"cmdtexttrue) == 0)
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            if(
IsABike(GetPlayerVehicleID(playerid)))
            {
                if(
CapaceteStatus[playerid] == 0)
                {
                    
SendClientMessage(playeridAzul,"Colocas-te 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 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,"Retiras-te o Capacete.");
                    
CapaceteStatus[playerid] = 0;
                    
RemovePlayerAttachedObject(playeridSLOT);
                }
            }
        }
        else
        {
            
SendClientMessage(playerid,Amarelo,"[CW-RP:] Nгo estбs numa mota!");
        }
        return 
0;
    }
    if (
strcmp("/cinto"cmdtexttrue) == 0)
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            if(
IsABike(GetPlayerVehicleID(playerid)))
            {
                
SendClientMessage(playerid,Amarelo"[CW-RP:] Nгo podes por o cinto numa mota. (Digita /capacete)");
                return 
1;
            }
            if(
CintoStatus[playerid] == 0)
            {
                
SendClientMessage(playerid,Azul,"Colocas-te o Cinto de Seguranзa.");
                
CintoStatus[playerid] = 1;
            }
            else if(
CintoStatus[playerid] == 1)
            {
                
SendClientMessage(playerid,Azul,"Retiras-te o Cinto de Seguranзa.");
                
CintoStatus[playerid] = 0;
            }
        }
        else
        {
            
SendClientMessage(playerid,Amarelo,"[CW-RP:] Nгo estбs num carro!");
        }
        return 
1;
    }
    return 
0;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == 2)
    if(
CintoStatus[playerid] == 1)
    {
        
SendClientMessage(playerid,Azul,"Retiras-te o Cinto de Seguranзa.");
        
CintoStatus[playerid] = 0;
    }
    if(
CapaceteStatus[playerid] == 1)
    {
        
SendClientMessage(playerid,Azul,"Retiras-te o Capacete.");
        
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
#2

Poste a public "Tontura".
Reply
#3

Como vocк pegou isto ae do forum e lб no topico nгo tem a public, entгo adicione-a oa seu FS:

PHP код:
public Tontura(playerid)
{
    
SetPlayerDrunkLevel(playerid,0);
    return 
1;

Reply
#4

jб deu obrigado
Reply
#5

De nada ... Qualquer coisa й so falar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)