03.11.2011, 21:13
hello I made a custom stock to easly compac teleport lines...
however I got a little problem with it...
here's the stock:
here some usages:
but I have got a little problem...
well
when I am in a vehicle and I teleport to something that should keep my vehicle, everything works...
when I am on foot and I teleport to something everything works
but when I am in a vehicle and I teleport to something that should destroy my vehicle and then teleport me there (because bool Vehicle remove was true) it gives me the message, the time and the weapons, but then it says unknown command and I don't get teleported...
rep for helper
Thanks in advance!
however I got a little problem with it...
here's the stock:
pawn Код:
stock AddPlayerTeleport(playerid, teleportname[], Float:x, Float:y, Float:z, TimeH, TimeM, bool:vehicleremove, Weapon, Ammo)
{
new
string[128],
cartype = GetPlayerVehicleID(playerid);
format(string, sizeof(string), "Teleported to %s", teleportname);
SendClientMessage(playerid, COLOR_SEXYGREEN, string);
ResetPlayerWeapons(playerid);
SetPlayerTime(playerid, TimeH ,TimeM);
SetTimer("LoadObjects", 1000, false);
TogglePlayerControllable(playerid, false);
GameTextForPlayer(playerid, "~r~Loading Objects...", 1000, 4);
if(Weapon != -1)
GivePlayerWeapon(playerid, Weapon, Ammo);
if(vehicleremove == true){
if(IsPlayerInAnyVehicle(playerid)){
DestroyVehicle(cartype);
}
}
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
return SetPlayerPos(playerid,x ,y ,z);
else if(IsPlayerInVehicle(playerid, cartype) == 1)
return SetVehiclePos(cartype,x, y, z);
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/island", true))
return AddPlayerTeleport(playerid, "Chill-Island", 261.1905,-3271.4392,5.7316, 21, 0, true, -1, -1);
if(!strcmp(cmdtext, "/chilliad", true))
return AddPlayerTeleport(playerid, "MT Chilliad", -2344.8931,-1603.9287,489.2245, 12, 0, false, 46, 1);
if(!strcmp(cmdtext, "/hh", true))
return AddPlayerTeleport(playerid, "Huge Halfpipe", -1252.8372802734,-3572.2570800781,19.23807144165, 12, 0, false, -1, -1);
well
when I am in a vehicle and I teleport to something that should keep my vehicle, everything works...
when I am on foot and I teleport to something everything works
but when I am in a vehicle and I teleport to something that should destroy my vehicle and then teleport me there (because bool Vehicle remove was true) it gives me the message, the time and the weapons, but then it says unknown command and I don't get teleported...
rep for helper
Thanks in advance!