[AJUDA]Cinto -
Manoloww - 30.03.2012
Seguinte,peguei um FS de Cinto aqui mesmo no forum,e quero editб-lo de forma que fique apenas um comando(/cinto),tanto pra por,quanto pra tirar o cinto,tentei colocar com o cуdigo:
pawn Код:
/////////////////////////////////////////////////////////•••••••••••••••••••••••••••••••••••••••••••••••••••////•• [INC]Sistema VIP ••////•• Criado por DraKoN ••////•• http://www.pawnsamp.blogspot.com ••////•• ••////•••••••••••••••••••••••••••••••••••••••••••••••••••/////////////////////////////////////////////////////////#include <a_samp>#define MEUS_SLOTS 20//************ Cores **************************#define AMARELO 0xFFFF00AA#define VERDE 0x33AA33A//********** Arrays ***************************new CintoPlayer
[MEUS_SLOTS
];
new bool:Cinto
[MAX_PLAYERS
];
//***************** CallBakcs (Detectar Batida *****************public OnVehicleDamageStatusUpdate
(vehicleid, playerid
){ if(CintoPlayer
[playerid
] == 0) { new Float:Px
= 0.000000,
Float:Py
= 0.000000,
Float:Pz
= 0.000000,
Float:Pa
= 0.000000,
Float:HV ;
GetPlayerPos
(playerid, Px, Py, Pz
);
//PEGA POS GetPlayerFacingAngle
(playerid, Pa
);
//PEGA ANGULO GetVehicleHealth
(vehicleid,HV
);
SetPlayerHealth
(playerid,HV
/10);
SetPlayerPos
(playerid,Px
+2,Py
+2,Pz
+1);
RemovePlayerFromVehicle
(playerid
);
//REMOVE VEICULO ApplyAnimation
(playerid,
"CRACK",
"crckdeth2",
4.0,
1,
0,
0,
0,
0);
ClearAnimations
(playerid
);
ApplyAnimation
(playerid,
"CRACK",
"crckdeth2",
4.0,
1,
0,
0,
0,
0);
SendClientMessage
(playerid,AMARELO,
"[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer");
SetTimer
("ANIM",
5000,
0);
SetPlayerWantedLevel
(playerid,
1);
} return 1;
}//************ CallBacks Para Anims **************************forward ANIM
(playerid
);
public ANIM
(playerid
){ ClearAnimations
(playerid
);
return 1;
}//*************** Call Backs Entra Veiculos ******************public OnPlayerEnterVehicle
(playerid, vehicleid, ispassenger
){ CintoPlayer
[playerid
] = 0;
GameTextForPlayer
(playerid,
"~r~/cinto Caso Contrario ~n~Morrer em Batidas",
3000,
4);
return 1;
}//******** Call Backs Comandos *******************************cmd:cinto
(playerid
){ if(Cinto
[playerid
]) { if(IsPlayerInAnyVehicle
(playerid
)) { if(CintoPlayer
[playerid
] == 1) { CintoPlayer
[playerid
] = 1;
SendClientMessage
(playerid,VERDE,
"Vocк Colocou o Cinto)");
SetPlayerWantedLevel
(playerid,
0);
}else{ SendClientMessage
(playerid,VERMELHO,
"[AVISO]: Vocк nгo esta em um Carro!");
} }else{ SendClientMessage
(playerid,VERDE,
"[AVISO]: Vocк Jб Esta com Cinto");
} return 1;
} else { if(IsPlayerInAnyVehicle
(playerid
)) { if(CintoPlayer
[playerid
] == 0) { CintoPlayer
[playerid
] = 0;
SendClientMessage
(playerid,AMARELO,
"[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
SetPlayerWantedLevel
(playerid,
0);
}else{ SendClientMessage
(playerid,VERDE,
"[AVISO]: Vocк nгo esta a um Carro");
} }else{ SendClientMessage
(playerid,VERDE,
"[AVISO]: Vocк Jб Esta sem Cinto");
} return 1;
} return 0;
} //*************** The End *************************************
Deu o Seguinte Erro:
Cinto.pwn(94) : warning 203: symbol is never used: "cinto"
Re: [AJUDA]Cinto -
ViniBorn - 30.03.2012
Jб existe a variбvel CintoPlayer , nгo precisa criar 'Cinto' .
Basta trabalhar com essa jб existente.
Re: [AJUDA]Cinto -
BreakDriFT - 30.03.2012
Edited.
Nem vi que o vini posto rs.
Re: [AJUDA]Cinto -
marcelodell - 30.03.2012
Parece que ou vocк inverteu as coisas ou eu que nгo entendi nada '-'.
pawn Код:
/////////////////////////////////////////////////////////•••••••••••••••••••••••••••••••••••••••••••••••••••////•• [INC]Sistema VIP ••////•• Criado por DraKoN ••////•• http://www.pawnsamp.blogspot.com ••////•• ••////•••••••••••••••••••••••••••••••••••••••••••••••••••/////////////////////////////////////////////////////////#include <a_samp>#define MEUS_SLOTS 20//************ Cores **************************#define AMARELO 0xFFFF00AA#define VERDE 0x33AA33A//********** Arrays ***************************new CintoPlayer
[MEUS_SLOTS
];
//***************** CallBakcs (Detectar Batida *****************public OnVehicleDamageStatusUpdate
(vehicleid, playerid
){ if(CintoPlayer
[playerid
] == 0) { new Float:Px
= 0.000000,
Float:Py
= 0.000000,
Float:Pz
= 0.000000,
Float:Pa
= 0.000000,
Float:HV ;
GetPlayerPos
(playerid, Px, Py, Pz
);
//PEGA POS GetPlayerFacingAngle
(playerid, Pa
);
//PEGA ANGULO GetVehicleHealth
(vehicleid,HV
);
SetPlayerHealth
(playerid,HV
/10);
SetPlayerPos
(playerid,Px
+2,Py
+2,Pz
+1);
RemovePlayerFromVehicle
(playerid
);
//REMOVE VEICULO ApplyAnimation
(playerid,
"CRACK",
"crckdeth2",
4.0,
1,
0,
0,
0,
0);
ClearAnimations
(playerid
);
ApplyAnimation
(playerid,
"CRACK",
"crckdeth2",
4.0,
1,
0,
0,
0,
0);
SendClientMessage
(playerid,AMARELO,
"[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer");
SetTimer
("ANIM",
5000,
0);
SetPlayerWantedLevel
(playerid,
1);
} return 1;
}//************ CallBacks Para Anims **************************forward ANIM
(playerid
);
public ANIM
(playerid
){ ClearAnimations
(playerid
);
return 1;
}//*************** Call Backs Entra Veiculos ******************public OnPlayerEnterVehicle
(playerid, vehicleid, ispassenger
){ CintoPlayer
[playerid
] = 0;
GameTextForPlayer
(playerid,
"~r~/cinto Caso Contrario ~n~Morrer em Batidas",
3000,
4);
return 1;
}//******** Call Backs Comandos *******************************cmd:cinto
(playerid
){ if(IsPlayerInAnyVehicle
(playerid
)) { if(CintoPlayer
[playerid
] == 0) { CintoPlayer
[playerid
] = 1;
SendClientMessage
(playerid,VERDE,
"Vocк Colocou o Cinto)");
SetPlayerWantedLevel
(playerid,
0);
} else { CintoPlayer
[playerid
] = 0;
SendClientMessage
(playerid,AMARELO,
"[AVISO]: Cuidado Vocк Retirou o Cinto, Pode Morrer (/cinto)");
SetPlayerWantedLevel
(playerid,
0);
} } else { SendClientMessage
(playerid,VERDE,
"[AVISO]: Vocк nгo esta em um Carro!");
} return 1;
}
@EDITIE
Codigo Recorrigido!
Re: [AJUDA]Cinto -
ViniBorn - 30.03.2012
pawn Код:
cmd:cinto(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(CintoPlayer[playerid] == 0)
{
CintoPlayer[playerid] = 1;
SendClientMessage(playerid,VERDE,"Vocк Colocou o Cinto)");
}
else
{
CintoPlayer[playerid] = 0;
SendClientMessage(playerid,AMARELO,"[AVISO]: Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
}
SetPlayerWantedLevel(playerid, 0);
}
else
SendClientMessage(playerid,VERMELHO,"[AVISO]: Vocк nгo esta em um Carro!");
return true;
}