Teleport only for PD/FBI/MILLITARY/SWAT
#1

Hello, i'm new in this scripting business but i know a few things and im trying to learn to make some teleport commands for certain factions, for example im trying to make a teleport command for a cop/fbi/millitary/swat to teleport right to the duty zone. I've done the code with the right cordonates but i can't get it to work. It works fine without the ifPlayerinfo but once i put that in its f*ckes up.

Here's the code:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp(cmdtext, "/lshq") == 0)
  if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2)
   {
     SetPlayerPos(playerid,254.2377,77.7456,1003.6406);
     SetPlayerInterior(playerid,6) ;
     return 1;
   }
   return 0;
}
Thanks alot, and sory to bother but i really want to learn this functions.

Thanks again!
Reply
#2

Try this you missed a bracket

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp(cmdtext, "/lshq") == 0)
{
  if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2)
   {
     SetPlayerPos(playerid,254.2377,77.7456,1003.6406);
     SetPlayerInterior(playerid,6) ;
     return 1;
   }
   return 0;
}
Reply
#3

Код:
C:\Documents and Settings\Kill3ru\Desktop\te.pwn(141) : warning 217: loose indentation
C:\Documents and Settings\Kill3ru\Desktop\te.pwn(144) : error 030: compound statement not closed at the end of file (started at line 133)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Comes back with a warning and error :\
Reply
#4

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(strcmp(cmdtext, "/lshq") == 0)
{
  if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2)
   {
     SetPlayerPos(playerid,254.2377,77.7456,1003.6406);
     SetPlayerInterior(playerid,6) ;
     return 1;
   }
}
   return 0;
}
Reply
#5

still not working
Reply
#6

pawn Код:
if(strcmp(cmdtext, "/lshq",true) == 0)
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2)
{
SetPlayerPos(playerid,254.2377,77.7456,1003.6406);
SetPlayerInterior(playerid,6) ;
}
return 1;
}
Reply
#7

thanks it worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)