CMD:eject(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_RED, "You need to be in a vehicle to use this command");
else
{
SetPlayerVelocity(playerid,0.0,0.0,5.0);
}
return 1;
}
CMD:eject(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_RED, "You need to be in a vehicle to use this command");
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
SetPlayerVelocity(playerid,0.0,0.0,5.0);
}
return 1;
}
CMD:eject(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_RED, "You need to be in a vehicle to use this command");
else
{
RemovePlayerFromVehicle(playerid);
SetPlayerVelocity(playerid,0.0,0.0,5.0);
}
return 1;
}
Originally Posted by Torran
pawn Код:
Still not working So how would i do this right? |
CMD:eject(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
SetPlayerVelocity(playerid,0.0,0.0,5.0);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a vehicle to use this command");
}
return 1;
}
CMD:eject(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
STUFF
}
else
{
STUFF
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new vehicleid = GetPlayerVehicleID(playerid); new modelid = GetVehicleModel(vehicleid); if((newkeys & KEY_HANDBRAKE)) { if(modelid == 476 || modelid == 520) // rustler and hydra { GivePlayerWeapon(playerid,46,1); new Float:pos[3]; GetPlayerPos(playerid,pos[0],pos[1],pos[2]); SetPlayerPos(playerid,pos[0],pos[1],pos[2]+400); GameTextForPlayer(playerid, "~R~Ejecting..", 5000, 5); } } return 1; }
Originally Posted by Torran
Thats not the problem,
The problem is its not setting my velocity, if(!IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid, COLOR_RED, "You need to be in a vehicle to use this command"); Is better than pawn Код:
|
Originally Posted by [AC
Etch ]
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new vehicleid = GetPlayerVehicleID(playerid); new modelid = GetVehicleModel(vehicleid); if((newkeys & KEY_HANDBRAKE)) { if(modelid == 476 || modelid == 520) // rustler and hydra { GivePlayerWeapon(playerid,46,1); new Float:pos[3]; GetPlayerPos(playerid,pos[0],pos[1],pos[2]); SetPlayerPos(playerid,pos[0],pos[1],pos[2]+400); GameTextForPlayer(playerid, "~R~Ejecting..", 5000, 5); } } return 1; } |