Moving gates problem 4 !
#1

Is there any tutorial to only open the gates if a player has that name or clan name ? Like command : /open and name : Kirchhoff and that gates only openes with my name or command : /open and name [SR] - clan name ?

Please help
Reply
#2

Easy:
1. Just get the player name:
pawn Код:
new
    pName[MAX_PLAYERS_NAME]
;
GetPlayerName(playerid, pName, sizeof(pName));
2. Just compare the names with each other
pawn Код:
if(!strcmp(pName, "Kirchhoff", true))
{
    MoveObject(objectid, &Float: X, &Float: Y, &Float:Z, &Float: MovingSpeed);
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "<!> You can't open this gate because your name is not Kirchhoff!");
Reply
#3

or maybe you can do it by keys ...
Reply
#4

This is even easier.

http://forum.sa-mp.com/index.php?topic=73014.0
Reply
#5

ducati09 : good ideea but if i put #include <t-Auto Gates> i get the following error :

Error :
Код:
D:\Gta san andreas\GTA San Andreas\server\gamemodes\slrpg.pwn(13934) : error 021: symbol already defined: "PlayerToPoint"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line 13934 :
Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
	new Float:oldposx, Float:oldposy, Float:oldposz, 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;
}
Must i remove this ? <<<
Reply
#6

Quote:
Originally Posted by Kirchhoff
ducati09 : good ideea but if i put #include <t-Auto Gates> i get the following error :

Error :
Код:
D:\Gta san andreas\GTA San Andreas\server\gamemodes\slrpg.pwn(13934) : error 021: symbol already defined: "PlayerToPoint"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line 13934 :
Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
	new Float:oldposx, Float:oldposy, Float:oldposz, 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;
}
Must i remove this ? <<<
Try only to remove this: public PlayerToPoint(Float:radi, playerid, Float, Float:y, Float:z)
{
Reply
#7

I removed all i hope works testing now !


Doesn't work !! I puted there
Код:
  AddAutoGate(980,2237.3050,2453.2110,11.421,0.0,0.0,90.00,2237.3050,2453.2110,1.421,"[LCN]Don_Salieri",50);
the default one but it doesn't appear . Any suggestions ?
Reply
#8

I solved the problem in another way Thank You for helping me !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)