Help with command.
#1

So. I'm creatin' my RP server from 0. So. I want to make entrance. my bulding is in LS Airport ( building build from empty garages. It's like walls. It without interior ). I want, that when i type command, player gonna be teleported there. My code:
Код:
if(!strcmp(cmdtext, "/enter", true)) // Entrance
	{
	if(PlayerToPoint(1,playerid,2458.3530,1327.0610,10.8203))
	{
	SetPlayerPos(playerid,1960.8862,-2347.9216,13.5469)
	return 1;
	}
	}
I'm get this error:
Код:
C:\Documents and Settings\Samsung\Desktop\LTRP\gamemodes\LTRP.pwn(141) : error 010: invalid function or declaration
C:\Documents and Settings\Samsung\Desktop\LTRP\gamemodes\LTRP.pwn(143) : error 010: invalid function or declaration
C:\Documents and Settings\Samsung\Desktop\LTRP\gamemodes\LTRP.pwn(146) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
141 line:
Код:
if(!strcmp(cmdtext, "/enter", true)) // Entrance
143 line:
Код:
if(PlayerToPoint(1,playerid,2458.3530,1327.0610,10.8203))
146 line:
Код:
return 1;
Thanks for help.
Reply
#2

pawn Код:
if(!strcmp(cmdtext, "/enter", true)) // Entrance
Basically telling the script if you type anything but /enter teleport me to 2458.3530,1327.0610,10.8203.

pawn Код:
if(strcmp(cmdtext, "/enter", true) ==0) // Entrance
Reply
#3

Nothing.
Reply
#4

Try this

pawn Код:
if (strcmp("/enter", cmdtext, true, 6) == 0) //entrance
    {
    if(PlayerToPoint(1,playerid,2458.3530,1327.0610,10.8203))
    {
    SetPlayerPos(playerid,1960.8862,-2347.9216,13.5469)
    return 1;
    }
    }
Reply
#5

You don't need the 6 there. Waste of time putting the 6 there.
Reply
#6

Quote:
Originally Posted by » Pawnst★r «
You don't need the 6 there. Waste of time putting the 6 there.
However , it might work (compile) for him
Reply
#7

Still nothing. Maybe there need some PlayerToPoint stock ar public?
Reply
#8

pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);

public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
    {
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        tempposx = (oldposx -x);
        tempposy = (oldposy -y);
        tempposz = (oldposz -z);
       
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
Reply
#9

Damn, nothing. Ok. Then maybe someone know how to make entrance's in another way?
Reply
#10

I would recommend you to use a Pickup .. And make the entrance under OnPlayerPickupPickup
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)