Teleport only for PD/FBI/MILLITARY/SWAT - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teleport only for PD/FBI/MILLITARY/SWAT (
/showthread.php?tid=129383)
Teleport only for PD/FBI/MILLITARY/SWAT -
Kill3ru - 21.02.2010
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!
Re: Teleport only for PD/FBI/MILLITARY/SWAT -
Torran - 21.02.2010
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;
}
Re: Teleport only for PD/FBI/MILLITARY/SWAT -
Kill3ru - 22.02.2010
Код:
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 :\
Re: Teleport only for PD/FBI/MILLITARY/SWAT -
MisterTickle - 22.02.2010
Код:
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;
}
Re: Teleport only for PD/FBI/MILLITARY/SWAT -
Kill3ru - 22.02.2010
still not working
Re: Teleport only for PD/FBI/MILLITARY/SWAT -
Torran - 22.02.2010
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;
}
Re: Teleport only for PD/FBI/MILLITARY/SWAT -
Kill3ru - 22.02.2010
thanks it worked