19.08.2010, 17:09
Well i made it so when i go into an area a sound plays.... well instead of it stopping while out of the area it keeps going... here is my script(if anyone can help please do):
i also have a timer setup on ongamemodeinit.
the sound just never stops!
also my gates not working :S
the tiemr for that is called when the command is spoken
pawn Код:
public IsPlayerInClub()
{
new Float:X, Float:Y, Float:Z; //We use this to store player position
for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the playerid is "i"
{
GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
if (X <= 1291.7345 && X >= 1264.4211 && Y <= 1336.7477 && Y >= 1311.3464 && playerinclub[i] == 0)
{
PlayerPlaySound(i, 1062, 0, 0, 0);
playerinclub[i] = 1;
}
else
{
PlayerPlaySound(i, 0, 0, 0, 0);
playerinclub[i] = 0;
}
}
return 1;
}
pawn Код:
forward IsPlayerInclub
the sound just never stops!
also my gates not working :S
pawn Код:
public ClubGate()
{
new Float:x,Float:y,Float:z;
GetObjectPos(980,x,y,z);
MoveObject(980,x,y,z,5);
}
pawn Код:
if(strcmp(cmdtext,"/CSHClub",true)==0)
{
if(strcmp("CSMajor", playersnames) || strcmp("[MF]Shark_killer", playersnames))
{
new Float:x,Float:y,Float:z;// i so d
GetObjectPos(980,x,y,z);
SetTimer("ClubGate",3000,false);
MoveObject(980,x+100,y,z, 5);
}
else
{
SendClientMessage(playerid,0xFFF0000FF,"Your name isnt CSMajor or [MF]Shark_killer!");
}
return 1;
}