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;
}
forward IsPlayerInclub
public ClubGate()
{
new Float:x,Float:y,Float:z;
GetObjectPos(980,x,y,z);
MoveObject(980,x,y,z,5);
}
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;
}
new Gate,GateOpen;
Gate=CreateObject(blabla) (this should be on OnGameModeInit)
if(strcmp(cmdtext,"/CSHClub",true)==0)
{
if(strcmp("CSMajor", playersnames) || strcmp("[MF]Shark_killer", playersnames))
{
if (GateOpen==0) { MoveObject(Gate,OPENPOSx,OPENPOSy,OPENPOSz, 5);GateOpen=1 }
else { MoveObject(Gate,CLOSEDPOSx,CLOSEDPOSy,CLOSEDPOSz, 5);GateOpen=0 }
}
else SendClientMessage(playerid,0xFFF0000FF,"Your name isnt CSMajor or [MF]Shark_killer!");
return 1;
}
PlayerPlaySound(i, 1062, 0, 0, 0);
If its a song use this PlayerPlaySound(i, 1063, 0, 0, 0); to stop it To move gate pawn Код:
|