Can someone help me? -
caldaia - 10.07.2009
i want create a gate whitch open ONLY when a player with "MR" tag go near this gate...
I already create the openable gate,but everyone can open it.How to make it openable only for MR?
here the important part of the script
#define FILTERSCRIPT
forward DoesPlayerHasTag(playerid,tag[]);
public DoesPlayerHasTag(playerid,tag[]) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return (strfind(name,tag,true) != -1) ? 1 : 0;
}
public kapucheck() {
new kozelbenvan;
for(new i = 0; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected (i)) {
if(GetPlayerDistanceToPointEx(i, coords[0][0], coords[0][1], coords[0][2]) < 10
&& i think i have to add something here ) {
kozelbenvan = 1;
break;
}
}
}
Re: Can someone help me? -
Khelif - 10.07.2009
heres my version..
Код:
OnGameModeInit() {
SetTimer("kapucheck",2000,1); //checks every 2 seconds
}
Код:
public kapucheck() {
new kozelbenvan;
for(new i=0; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
new name[MAX_PLAYER_NAME];
GetPlayerName(i,name,sizeof(name));
if(GetPlayerDistanceToPointEx(i, coords[0][0], coords[0][1], coords[0][2]) < 10 && strfind(name(i),"Mr",false) == 0) {
kozelbenvan = 1;
break;
}
}
}
}
Re: Can someone help me? -
caldaia - 10.07.2009
#include <a_samp>
#include <midostream>
new Float:coords[2][3] = {
{-1194.570313, -989.482788, 129.522934}
{-1194.570313, -989.482788, 121.522934}
};
forward kapucheck();
new kapu;
public OnFilterScriptInit()
{
//CORDINATES FOR DOCKS ISLAND 4817.332031, -612.075745, 22.573458
//CORDINATES FOR DEAD ISLAND 3558.705811, 67.161369, 0.925715
kapu = CreateObject(3352, coords[0][0], coords[0][1], coords[0][2], 0, 0, 0);
SetTimer("kapucheck", 1000, 1);
CreateStreamObject(1491, -1166.470337, -1059.297852, 128.313217, 0.0000, 0.0000, 0.0000, 180);
all the other object ect ect...
return 1;
}
public kapucheck() {
new kozelbenvan;
for(new i=0; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
new name[MAX_PLAYER_NAME];
GetPlayerName(i,name,sizeof(name));
if(GetPlayerDistanceToPointEx(i, coords[0][0], coords[0][1], coords[0][2]) < 10 && strfind(name(i),"Mr",false) == 0) {
kozelbenvan = 1;
break;
}
}
}
}
if(kozelbenvan) nyitas();
else zaras();
}
nyitas() {
new Float
![angry](images/smilies/mad.gif)
, Float:y, Float:z;
GetObjectPos(kapu, x, y, z);
if(x == coords[0][0]) {
MoveObject(kapu, coords[1][0], coords[1][1], coords[1][2], 4);
}
}
zaras() {
new Float
![angry](images/smilies/mad.gif)
, Float:y, Float:z;
GetObjectPos(kapu, x, y, z);
if(x == coords[1][0]) {
MoveObject(kapu, coords[0][0], coords[0][1], coords[0][2], 4);
}
}
GetPlayerDistanceToPointEx(playerid,Float
![angry](images/smilies/mad.gif)
,Float: y,Float:z) {
new Float
![angry](images/smilies/mad.gif)
1,Float:y1,Float:z1;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2) +floatpower(floatabs(floatsub(y,y1)),2)+floatpower (floatabs(floatsub(z,z1)),2));
return floatround(tmpdis);
}
C:\Documents and Settings\Giulio Vattuone\Desktop\mrmaps.pwn(22) : warning 217: loose indentation
C:\Documents and Settings\Giulio Vattuone\Desktop\mrmaps.pwn(25) : warning 217: loose indentation
C:\Documents and Settings\Giulio Vattuone\Desktop\mrmaps.pwn(121) : warning 217: loose indentation
C:\Documents and Settings\Giulio Vattuone\Desktop\mrmaps.pwn(122) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Giulio Vattuone\Desktop\mrmaps.pwn(122) : warning 215: expression has no effect
C:\Documents and Settings\Giulio Vattuone\Desktop\mrmaps.pwn(122) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Giulio Vattuone\Desktop\mrmaps.pwn(122) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Giulio Vattuone\Desktop\mrmaps.pwn(122) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
suggestion?
Re: Can someone help me? -
caldaia - 14.07.2009
no one can give me a help??
Re: Can someone help me? -
caldaia - 15.07.2009
please gimme a help!!!
Re: Can someone help me? -
caldaia - 16.07.2009
PLESE GIMME A HAND!!!
Re: Can someone help me? -
woot - 16.07.2009
Remove that thing the guy previously said and ..
pawn Код:
if(GetPlayerDistanceToPointEx(i, coords[0][0], coords[0][1], coords[0][2]) < 10 && DoesPlayerHasTag(i, "MR")) {
Re: Can someone help me? -
caldaia - 17.07.2009
![Cheesy](images/smilies/biggrin.png)
thanks soo much