Goto, Get Here
#1

If i am in a vehicle then i do, /goto, then the vehicle should follow me witch it dosent.. same with "Get Here"

Anyone who can FIX it?

Goto
pawn Код:
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerVirtualWorld(targetid,GetPlayerVirtualWorld(playerid));
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x,y,z);
SetPlayerPos(playerid, x+1,y,z);
Get Here
pawn Код:
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerVirtualWorld(targetid,GetPlayerVirtualWorld(playerid));
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
SetPlayerPos(targetid, x+1,y,z);
And O.o Why dosend this work =/ (im using a dialog)

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        format(string, sizeof(string), "Server admin have killed evryone, Muwhaha");
        SendClientMessageToAll(COLOR_ADMIN, string);

        SetPlayerHealth(i, 0);
        return 1;
    }
Reply
#2

Here's your goto with vehicle stuff.

pawn Код:
new
    Float:x,
    Float:y,
    Float:z,
    vehid = GetPlayerVehicleID(playerid),
    interior = GetPlayerInterior(targetid),
    world = GetPlayerVirtualWorld(targetid);
   
GetPlayerPos(targetid, x,y,z);
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerVirtualWorld(targetid,GetPlayerVirtualWorld(playerid));

if(vehid)
{
    SetVehiclePos(vehid,x+1,y,z+3);
    LinkVehicleToInterior(vehid,interior);
    SetVehicleVirtualWorld(vehid,world);
    return 1;
}
else
{
    SetPlayerPos(playerid, x+1,y,z);
    return 1;
}
Just reverse the playerid's with the targetid's and vice versa.
Reply
#3

THANK YOU

But O.o why dosent this work?

pawn Код:
if(listitem == 24)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        format(string, sizeof(string), Server admin have killed evryone, Muwhaha");
        SendClientMessageToAll(COLOR_ADMIN, string);

        SetPlayerHealth(i, 0);
        return 1;
    }
}
Reply
#4

pawn Код:
if(listitem == 24)
{
    SendClientMessageToAll(COLOR_ADMIN, "Server admin have killed evryone, Muwhaha");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerHealth(i, 0);
    }
    return 1;
}
Several things wrong with it. First of all it spams everybody every time it kills someone. Secondly, there's no need to format the message. Thirdly, and the actual reason it doesn't work, is because you returned 1 inside the loop. You only return something inside a loop when you want to end it. The way you had it, the loop closed after the first iteration. If it doesn't work now, it's because the listitem isn't 24.
Reply
#5

Quote:
Originally Posted by Backwardsman97
Посмотреть сообщение
pawn Код:
if(listitem == 24)
{
    SendClientMessageToAll(COLOR_ADMIN, "Server admin have killed evryone, Muwhaha");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerHealth(i, 0);
    }
    return 1;
}
Several things wrong with it. First of all it spams everybody every time it kills someone. Secondly, there's no need to format the message. Thirdly, and the actual reason it doesn't work, is because you returned 1 inside the loop. You only return something inside a loop when you want to end it. The way you had it, the loop closed after the first iteration. If it doesn't work now, it's because the listitem isn't 24.
Awww, Awesome man Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)