16.02.2013, 13:43
pawn Код:
CMD:gotoplayervehicle(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 2) {
new
userID,
veh = GetPlayerVehicleID(playerid)
;
if(sscanf(params, "u", userID))
return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/gotoplayervehicle [playerid]");
if(userID == INVALID_PLAYER_ID)
return SendClientMessage(playerid, COLOR_GREY, "Player Is not online");
if(playerVariables[userID][pCarID] < 1)
return SendClientMessage(playerid, COLOR_GREY, "This playerdoesn't own vehicle.");
new
messageString[64];
GetVehiclePos(playerVariables[userID][pCarID], playerVehicleVariables[veh][pVehiclePosition][0], playerVehicleVariables[veh][pVehiclePosition][1], playerVehicleVariables[veh][pVehiclePosition][2]);
SetPlayerPos(playerid, playerVehicleVariables[veh][pVehiclePosition][0], playerVehicleVariables[veh][pVehiclePosition][1]+2, playerVehicleVariables[veh][pVehiclePosition][2]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, GetVehicleVirtualWorld(playerVariables[userID][pCarID]));
format(messageString, sizeof(messageString), "You've teleported to %s's %s", playerVehicleVariables[veh][pVehicleOwner], VehicleNames[playerVehicleVariables[veh][pVehicleModelID] - 400]);
SendClientMessage(playerid, COLOR_WHITE, messageString);
}
return 1;
}