29.10.2012, 16:52
(
Последний раз редактировалось Vinicius_TroLL; 29.10.2012 в 20:04.
)
Edit
Encerrado
Encerrado
if(strcmp(cmd, "/Corda", true) == 0){
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 497){
Sliding[playerid] = 1;
new Float:X,
Float:Y,
Float:Z;
GetPlayerPos(playerid, X, Y, Z);
RemovePlayerFromVehicle(playerid); // Remove o jogador do veiculo
TogglePlayerControllable(playerid, 0); //Congela o jogador o que essa linha DIZ ? entao se mudar para 1 depois que ele alcanзar a posiзao ele vai se movimentar!
SetTimerEx("Slide", 400, 0, "i", playerid); //Settimer de 400 ms
SendClientMessage(playerid, COLOR_WHITE, "Voce esta descendo do helicуptero!");
}
else
SendClientMessage(playerid,-1, "{FF0000}[ERRO] Vocк nгo esta em um Helicуptero!");
return 1;
}
public Slide(playerid){
if(Sliding[playerid] == 1){
new Float:X,
Float:Y,
Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z - 5.00);
DestroyObject(Corda[playerid]);
Corda[playerid] = CreateObject(19089, X, Y, Z, 0.0, 0.0, 0.0, 300.0);
SetTimerEx("Slide", 1000, 0, "i", playerid);
}
return 1;
}
//agora tente fazer ae eu nao posso ajudar nao entendi o modo desse codigo se ele estivesse pelo menos completo!
if(strcmp(cmd, "/corda", true) == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 497)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
Sliding[playerid] = 1;
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, true);
SetTimerEx("Slide", 400, 0, "i", playerid);
SendClientMessage(playerid, COLOR_WHITE, "Vocк estб descendo do helicуptero!");
}
else
{
SendClientMessage(playerid,-1, "{FF0000}[ERRO] Vocк nгo estб em um helicуptero!");
}
return 1;
}
if(strcmp(cmd, "/parar", true) == 0)
{
if(Sliding[playerid] == 1)
{
Sliding[playerid] = 0;
TogglePlayerControllable(playerid, false);
SendClientMessage(playerid, COLOR_WHITE, "Vocк chegou ao chгo!");
DestroyObject(Corda[playerid]);
}
return 1;
}
#include <a_samp>
new Corda[MAX_PLAYERS];
new Sliding[MAX_PLAYERS];
#define TimerSegundo(%0) %0*1000
#define Callback<q.i>%0(%1) forward %0(%1); public %0(%1)
public OnPlayerConnect(playerid){
Sliding[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]){
if(strcmp(cmd, "/Corda", true) == 0){
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 497){
Sliding[playerid] = 1;
new Float:X,
Float:Y,
Float:Z;
GetPlayerPos(playerid, X, Y, Z);
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 0);
Corda[playerid] = CreateObject(19089, X, Y, Z, 0.0, 0.0, 0.0, 300.0);
SetTimerEx("Slide", TimerSegundo(1), 0, "i", playerid);
SendClientMessage(playerid, -1, "Voce esta descendo do helicуptero!");
}
else
SendClientMessage(playerid,-1, "[ERRO] Vocк nгo esta em um Helicуptero!");
return true;
}
if(strcmp(cmd, "/parar", true) == 0){
if(Sliding[playerid] == 1){
Sliding[playerid] = 0;
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid,-1, "Vocк chegou ao chгo");
DestroyObject(Corda[playerid]);
}
return true;
}
return false;
}
Callback<q.i>Slide(playerid){
if(Sliding[playerid] == 1){
new Float:X,
Float:Y,
Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z - 5.00);
SetTimerEx("Slide", TimerSegundo(1), 0, "i", playerid);
}
return true;
}