CMD:event1(playerid, params[]) // SPEED-RACER (rules who got first place win!!!)
{
if(IsPlayerAdmin(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), -1397.782470, -203.723114, 1051.346801);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 93.569358);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 7);
SetPlayerPos(playerid, -1397.782470, -203.723114, 1051.346801);
SetPlayerFacingAngle(playerid, 93.569358);
SetPlayerInterior(playerid, 7);
SendClientMessage(playerid, COLOR_RED, "!!Teleported!!");
}
}
else SendClientMessage(playerid,-1,"Only Rcon admins");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
CMD:event1(playerid, params[]) //When a player types "/event1"
{
if(IsPlayerAdmin(playerid))
{
//Everything in here will only be executed if the player is an RCON admin
if(IsPlayerInAnyVehicle(playerid))
{
//Everything in here will only be executed if the player is in a vehicle.
SetVehiclePos(GetPlayerVehicleID(playerid), -1397.782470, -203.723114, 1051.346801);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 93.569358);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 7);
SetPlayerPos(playerid, -1397.782470, -203.723114, 1051.346801);
SetPlayerFacingAngle(playerid, 93.569358);
SetPlayerInterior(playerid, 7);
SendClientMessage(playerid, COLOR_RED, "!!Teleported!!");
}
//If the player is not in a vehicle, everything here will be executed
//There is nothing here though? Nothing will be called...
}
else SendClientMessage(playerid,-1,"Only Rcon admins");
return 1;
}
CMD:event1(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only RCON admins can use this command.");
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //Player is a driver
{
new vid = GetPlayerVehicleID(playerid);
SetVehiclePos(vid, -1397.782470, -203.723114, 1051.346801);
SetVehicleZAngle(vid, 93.569358);
LinkVehicleToInterior(vid, 7);
}
else //Player is not a driver
{
SetPlayerPos(playerid, -1397.782470, -203.723114, 1051.346801);
SetPlayerFacingAngle(playerid, 93.569358);
}
SetPlayerInterior(playerid, 7);
SendClientMessage(playerid, COLOR_RED, "!!Teleported!!");
return 1;
}
SetPlayerInterior(playerid,7);
PutPlayerInVehicle(playerid,vid);
@Threshold
Your code will send only the vehicle to that position if he is a driver.... Below the LinkVehicleToInterior line add these two lines pawn Код:
|
CMD:event1(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only RCON admins can use this command.");
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //Player is a driver
{
new vid = GetPlayerVehicleID(playerid);
SetVehiclePos(vid, -1397.782470, -203.723114, 1051.346801);
SetVehicleZAngle(vid, 93.569358);
LinkVehicleToInterior(vid, 7);
}
else //Player is not a driver
{
SetPlayerPos(playerid, -1397.782470, -203.723114, 1051.346801);
SetPlayerFacingAngle(playerid, 93.569358);
}
SetPlayerInterior(playerid, 7);
SendClientMessage(playerid, COLOR_RED, "!!Teleported!!");
return 1;
}
SetPlayerInterior(targetid, GetPlayerInterior(playerid));