11.02.2012, 21:04
existe alguma callback que verifica se o player caiu do veiculo ?
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, -1, "Vocк acabou de sair ou cair de uma moto/carro!");
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate) { if(oldstate == PLAYER_STATE_DRIVER) { new Float:a[3]; GetPlayerVelocity(playerid,a[0],a[1],a[2]); new lala = floatround( floatsqroot(floatpower(a[0],2)+floatpower(a[1],2))*250 ); if(lala > 30) SendClientMessage(playerid, -1,"{ff0000}Vocк levou um baita de um tombo, rapaz!"); } return 1; }
public OnPlayerStateChange(playerid, newstate, oldstate) { if(oldstate == PLAYER_STATE_DRIVER) { new Float:a[3]; GetPlayerVelocity(playerid,a[0],a[1],a[2]); new lala = floatround( floatsqroot(floatpower(a[0],2)+floatpower(a[1],2))*250 ); if(lala > 30) MinhaCallBack(playerid); } return 1; } forward MinhaCallBack(playerid); public MinhaCallBack(playerid) { // aqui vc poem oq qr q aconteзa qdo o playerid cair do veнculo }
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) {
for(new i; i < MAX_PLAYERS; i++) {
if(GetPlayerVehicleID(playerid) == VeiculoID[i]) {
if(GetPlayerVehicleID(playerid) == VeiculoID[playerid]) {
format(gstring, sizeof(gstring), "{EE3B3B}[INFO]: {FFFFFF}%s seja bem vindo ao seu veнculo criado por vocк.", PlayerName(playerid));
SendClientMessage(playerid, 0x9966FFAA, gstring);
Delete3DTextLabel(TextVeH[GetPlayerVehicleID(playerid)]);
}
else if(GetPlayerVehicleID(playerid) != VeiculoID[playerid]) {
if(GetPlayerVehicleID(playerid) == VeiculoID[i]) {
format(gstring, sizeof(gstring), "{EE3B3B}[INFO]: {FFFFFF}Esse veнculo pertence a '%s' e vocк nao pode dirigi-lo, use: {EE3B3B}/v {FFFFFF}para criar.", PlayerName(VeiculoID[playerid]));
SendClientMessage(playerid, 0xFF6633AA, gstring);
PlayerPlaySound(playerid, 1147, 0.0, 0.0, 0.0);
RemovePlayerFromVehicle(playerid);
}
else {
Update3DTextLabelText( TextVeH[ GetPlayerVehicleID( playerid ) ], -1, gstring );
}
}
if( oldstate == PLAYER_STATE_DRIVER ) {
if(GetPlayerVehicleID(playerid) == VeiculoID[i]) {
if(GetPlayerVehicleID(playerid) == VeiculoID[playerid]) {
format(gstring, 256, "{FFFACD}Veнculo de:\n{FFFFFF}%s {FFFACD}[ID:%d]",PlayerName(playerid), playerid);
TextVeH[GetPlayerVehicleID(playerid)] = Create3DTextLabel(gstring, -1, 0.0, 0.0, 0.0, 50.0, 0, 1);
Attach3DTextLabelToVehicle(TextVeH[GetPlayerVehicleID(playerid)], VeiculoID[playerid], 0.0, 0.0, 0.0+1);
Update3DTextLabelText( TextVeH[ GetPlayerVehicleID( playerid ) ], -1, gstring );
SendClientMessage(playerid, -1, "{EE3B3B}[INFO]: {FFFFFF}Voce pode puxar o seu veнculo ate voce usando: /trazerv");
}
}
}
}
}
}
return 1;
}