Simple Help
#1

My problem is that everytime I teleport to drag and do leave. It spawn me somewhere in map with a cigar sometimes wine. But I already have set my random spawn points under OnPlayerSpawn. The problem only occur in this drag place. Also if i'm not in a drag or other place and i'm in a vehicle. Then do drag again the vehicle destroyed after I teleport to drag, but I've already link the vehicle into the world+interior. as you can see below.. Anymind helping? Thanks in advance.


pawn Код:
CMD:drag(playerid, params[])
{
        if(!IsPlayerInAnyVehicle(playerid)){
        SetCameraBehindPlayer(playerid);
        SetPlayerFacingAngle( playerid, 0);
        SetPlayerHealth(playerid, 100);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 3);
        }
        else
        {
        new veh = GetPlayerVehicleID(playerid);
        SetPlayerHealth(playerid, 100);
        SetVehicleZAngle(veh, 0);
        SetCameraBehindPlayer(playerid);
        LinkVehicleToInterior(veh, 0);
        SetCameraBehindPlayer(playerid);
        SetVehicleVirtualWorld(veh, 3);
        PutPlayerInVehicle(playerid, veh, 0);
        }
        return GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Drag Area",2000,3);
}
Reply
#2

Fixed (not tested)
pawn Код:
CMD:drag(playerid, params[])
{
       SetPlayerPos(playerid,drag coords);
       SetPlayerVirtualWorld(playerid,0);
       else
       if(IsPlayerInAnyVehicle(playerid);
       SetPlayerVehiclePos(playerid,drag coords inside a vehicle);
       SetPlayerVirtualWorld(playerid,0);
       return 1;
// To take the coords go to your drag map location and do /save in the player/vehicle spawn
}
I removed some useless stuff(they had no effect(useless lines))
Let me tell you your mistakes:
First you've placed no player/vehicle coords
Second you were teleporting the player to VirtualWorld3(your random thing)
Third your code was wrong.
Fourth i fixed your code just add your player and vehicle pos
Reply
#3

Quote:
Originally Posted by Johnson_Brooks
Посмотреть сообщение
Fixed (not tested)
pawn Код:
CMD:drag(playerid, params[])
{
       SetPlayerPos(playerid,drag coords);
       SetPlayerVirtualWorld(playerid,0);
       else
       if(IsPlayerInAnyVehicle(playerid);
       SetPlayerVehiclePos(playerid,coords inside a vehicles);
       SetPlayerVirtualWorld(playerid,0);
        return 1;
}
I removed some useless stuff(they had no effect(useless lines))
Let me tell you your mistakes:
First you've placed no player/vehicle coords
Second you were teleporting the player to VirtualWorld3(your random thing)
Third your code was wrong.
Fourth i fixed your code just add your player and vehicle pos
Gonna test it now, but let me know you that I have already set my player position using this.

pawn Код:
new Random = random(sizeof(RandomSpawnDrag));
SetPlayerPos(playerid, RandomSpawnDrag[Random][0], RandomSpawnDrag[Random][1], RandomSpawnDrag[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnDrag[Random][3]);
Reply
#4

That code is kinda useless because you did not used it in the /drag command.
And just add new coords in the /drag command.
And if your drag map is big,go to different places and do /save [name] and use the
pawn Код:
switch  and case:
Reply
#5

Quote:
Originally Posted by Johnson_Brooks
Посмотреть сообщение
That code is kinda useless because you did not used it in the /drag command.
And just add new coords in the /drag command.
And if your drag map is big,go to different places and do /save [name] and use the
pawn Код:
switch  and case:
i did.. look. try it ingame read my signature meet me there if its okay. i really need to solve this. appreciate your help!

here's the whole code for ya

pawn Код:
CMD:drag(playerid, params[])
{
        if(GetPVarInt(playerid, "CMDDisabled") != 0)
        {
        ShowPlayerDialog(playerid, DIALOG_EVADE, DIALOG_STYLE_MSGBOX, "Leave Menu", "You must Leave first before using this command", "Leave", "Cancel");
        return 1;
        }
        SetCameraBehindPlayer(playerid);
        SetPlayerFacingAngle( playerid, 0);
        SetPlayerHealth(playerid, 100);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 3);
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "{6666FF}(/drag) {00CCFF}%s {6666FF}has Teleported to Drag Area",pName);
        SendClientMessageToAll(0xFFFFFFFF, string);
        }
        else
        {
        if(IsPlayerInAnyVehicle(playerid);
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "{6666FF}(/drag) {00CCFF}%s {6666FF}has Teleported to Drag Area",pName);
        SendClientMessageToAll(0xFFFFFFFF, string);
        new veh = GetPlayerVehicleID(playerid);
        SetPlayerHealth(playerid, 100);
        SetVehicleZAngle(veh, 0);
        SetCameraBehindPlayer(playerid);
        LinkVehicleToInterior(veh, 0);
        SetCameraBehindPlayer(playerid);
        SetVehicleVirtualWorld(veh, 3);
        PutPlayerInVehicle(playerid, veh, 0);
        }
        pInEvent[playerid] = 1;
        SetPVarInt(playerid, "CMDDisabled", 2);
        new Random = random(sizeof(RandomSpawnDrag));
        SetPlayerPos(playerid, RandomSpawnDrag[Random][0], RandomSpawnDrag[Random][1], RandomSpawnDrag[Random][2]);
        SetPlayerFacingAngle(playerid, RandomSpawnDrag[Random][3]);
        DragCurrentRCP[playerid] = 1;
        SetPlayerRaceCheckpoint(playerid, 0, DragRCP[0][0], DragRCP[0][1], DragRCP[0][2], DragRCP[1][0], DragRCP[1][1], DragRCP[1][2], 15);
        return GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Drag Area",2000,3);
}
Reply
#6

pawn Код:
CMD:drag(playerid, params[])
{
   if(IsPlayerInAnyVehicle(playerid)){
     new veh = GetPlayerVehicleID(playerid);
     SetPlayerHealth(playerid, 100);
     SetVehicleZAngle(veh, 0);
     SetCameraBehindPlayer(playerid);
     LinkVehicleToInterior(veh, 0);
     SetCameraBehindPlayer(playerid);
     SetVehicleVirtualWorld(veh, 3);
     PutPlayerInVehicle(playerid, veh, 0);
     GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Drag Area",2000,3);
     }
    else
     {
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle( playerid, 0);
    SetPlayerHealth(playerid, 100);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 3);
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by [xB]Lordz
Посмотреть сообщение
pawn Код:
CMD:drag(playerid, params[])
{
   if(IsPlayerInAnyVehicle(playerid)){
     new veh = GetPlayerVehicleID(playerid);
     SetPlayerHealth(playerid, 100);
     SetVehicleZAngle(veh, 0);
     SetCameraBehindPlayer(playerid);
     LinkVehicleToInterior(veh, 0);
     SetCameraBehindPlayer(playerid);
     SetVehicleVirtualWorld(veh, 3);
     PutPlayerInVehicle(playerid, veh, 0);
     GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Drag Area",2000,3);
     }
    else
     {
    SetCameraBehindPlayer(playerid);
    SetPlayerFacingAngle( playerid, 0);
    SetPlayerHealth(playerid, 100);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 3);
    }
    return 1;
}
Yo lordz! Still same problem. It automatically destroy the vehicle after teleporting in drag. If I leave the animation is like I get killed (zooming out) but hp still full, weird o_0..


EDIT: NOT ONLY in that drag problem exist in world 1 and above. the vehicle doesn't link.
Reply
#8

This may help
pawn Код:
CMD:drag(playerid, params[])
{
   if(IsPlayerInAnyVehicle(playerid)){
     new veh = GetPlayerVehicleID(playerid);
     SetPlayerHealth(playerid, 100.00);
     SetVehicleHealth(veh,1000.00);
     SetVehicleZAngle(veh, 0);
     LinkVehicleToInterior(veh, 0);
     SetCameraBehindPlayer(playerid);
     SetVehicleVirtualWorld(veh, 3);
     GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Drag Area",2000,3);
     return 1;
}
//Merge other also,this is for vehicle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)