SetPlayerPos doesn't work anymore
#1

I don't know.. i started again my gamemode and setplayerpos doesn't work anymore.
I don't know why, but it doesn't work. Every commands that has a SetPlayerPos inside works and it doesn't teleport you.
I noticed this problem after I put on incognito's streamer, but I don't know if it makes it happen or it's something else.
Reply
#2

Can you post all the command with SetPlayerPos function?
Reply
#3

Quote:
Originally Posted by |-Ruben-|
Посмотреть сообщение
Can you post all the command with SetPlayerPos function?
I should post a full gamemode, because it is a roleplay gamemode.
I can post you an example.

CMD:gotopd(playerid, params[])
{
if(PlayerInfo[playerid][Admin] > 0 || PlayerInfo[playerid][Helper] > 0) {
SetPlayerPos(playerid, 1520.1942,-1666.2303,13.5469);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);}
return 1;
}

CMD:gotoganton(playerid, params[])
{
if(PlayerInfo[playerid][Admin] > 0 || PlayerInfo[playerid][Helper] > 0) {
SetPlayerPos(playerid, 2227.8057,-1725.0481,13.5477);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);}
return 1;
}


noone of this works.
Reply
#4

Give us some more information. We can't help you without that.
Reply
#5

Quote:
Originally Posted by Inverse
Посмотреть сообщение
Give us some more information. We can't help you without that.
I don't know what to tell you.
I just know after I put incognito's streamer I noticed this bug but I don't know if it is actually caused from it.
Reply
#6

Try this ingame, I'm sure it doesn't work because you're either not an admin or a helper.

pawn Код:
CMD:gotopd(playerid, params[])
{
    if(PlayerInfo[playerid][Admin] > 0 || PlayerInfo[playerid][Helper] > 0)
    {
        SetPlayerPos(playerid, 1520.1942,-1666.2303,13.5469);
        SetPlayerInterior(playerid,0);
        SetPlayerVirtualWorld(playerid,0);
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not a admin or a helper.");
    }
    return 1;
}

CMD:gotoganton(playerid, params[])
{
    if(PlayerInfo[playerid][Admin] > 0 || PlayerInfo[playerid][Helper] > 0)
    {
        SetPlayerPos(playerid, 2227.8057,-1725.0481,13.5477);
        SetPlayerInterior(playerid,0);
        SetPlayerVirtualWorld(playerid,0);
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not a admin or a helper.");
    }
    return 1;
}
Reply
#7

Ok, first thing to do is debug. add print messages before and after you used the setplayerpos command and check your server console afterwards, tell me whether or not both print messages (ones before and after SetPlayerPos) show up. If so, test again after turning off Incognito's streamer to see whether it has anything to do with it. Also try updating all the includes (again if needed) from the Sa-mp website.
Reply
#8

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
Ok, first thing to do is debug. add print messages before and after you used the setplayerpos command and check your server console afterwards, tell me whether or not both print messages (ones before and after SetPlayerPos) show up. If so, test again after turning off Incognito's streamer to see whether it has anything to do with it. Also try updating all the includes (again if needed) from the Sa-mp website.
Okay, I'm trying.


Quote:
Originally Posted by Sasoft
Посмотреть сообщение
Try this ingame, I'm sure it doesn't work because you're either not an admin or a helper.

pawn Код:
CMD:gotopd(playerid, params[])
{
    if(PlayerInfo[playerid][Admin] > 0 || PlayerInfo[playerid][Helper] > 0)
    {
        SetPlayerPos(playerid, 1520.1942,-1666.2303,13.5469);
        SetPlayerInterior(playerid,0);
        SetPlayerVirtualWorld(playerid,0);
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not a admin or a helper.");
    }
    return 1;
}

CMD:gotoganton(playerid, params[])
{
    if(PlayerInfo[playerid][Admin] > 0 || PlayerInfo[playerid][Helper] > 0)
    {
        SetPlayerPos(playerid, 2227.8057,-1725.0481,13.5477);
        SetPlayerInterior(playerid,0);
        SetPlayerVirtualWorld(playerid,0);
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not a admin or a helper.");
    }
    return 1;
}
No, I'm sure I'm admin (because I tester other admin cmds)
Reply
#9

Quote:
Originally Posted by Andriensis
Посмотреть сообщение
Okay, I'm trying.




No, I'm sure I'm admin (because I tester other admin cmds)
Have you tried to execute the command without the if statement?
Reply
#10

CMD:gotopd(playerid, params[])
{
printf("before if");
if(PlayerInfo[playerid][Admin] > 0 || PlayerInfo[playerid][Helper] > 0) {
printf("after if");
SetPlayerPos(playerid, 1520.1942,-1666.2303,13.5469);
printf("setplayerpos done");
SetPlayerInterior(playerid,0);
printf("setplayerinterior done");
SetPlayerVirtualWorld(playerid,0);
printf("setplayervw done");}
return 1;
}

[13:41:30] before if
[13:41:30] after if
[13:41:30] setplayerpos done
[13:41:30] setplayerinterior done
[13:41:30] setplayervw done
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)