[SOLVED] Teleporting...
#1

Hi guys i have this script
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/test", cmdtext, true, 10) == 0)
	{
	if (IsPlayerInAnyVehicle(playerid)) {
	SetVehiclePos(GetPlayerVehicleID(playerid), 1234.16978, 1252.26287, 6126.62168);
	}
	else {
	SetPlayerPos(playerid, 1234.16978, 1252.26287, 6126.62168);
	}
}
Oh sorry i meant that it teleports me but it sends me out SERVER: Unknown Command
Reply
#2

It should work. There's something else wrong
Reply
#3

pawn Код:
return 1;
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(GetPlayerVehicleID(playerid), 1234.16978, 1252.26287, 6126.62168);
        } else {
            SetPlayerPos(playerid, 1234.16978, 1252.26287, 6126.62168);
        }
        return 1; // end
    }
    return 0;
}
Reply
#4

Try this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 10) == 0)

    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(GetPlayerVehicleID(playerid), 1234.16978, 1252.26287, 6126.62168);

        }
        else
        {
            SetPlayerPos(playerid, 1234.16978, 1252.26287, 6126.62168);

        }
    }
    return 1;
}
EDIT: Aww you won me xD
Reply
#5

Код:
if(!strcmp(cmdtext,"/test",true))
{
	if(!IsPlayerInAnyVehicle(playerid))return SetPlayerPos(...);
	else return SetVehiclePos(GetPlayerVehicleID(playerid),...);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)