Problem - Gate open/Close ( Every one can open/close )
#1

FIXED, THANK YOU GUYS. THIS FORUM IS REALLY HELPFULL
Reply
#2

if(IsPlayerInRangeOfPoint(playerid,8,-308.49820, 1508.65869, 74.33560) && add your level check here)
Reply
#3

IT works but I want to use [dRank] >= 1) instead of 1 how can I do that?
Reply
#4

Quote:
Originally Posted by Nicker
View Post
if(IsPlayerInRangeOfPoint(playerid,8,-308.49820, 1508.65869, 74.33560) && add your level check here)
IT works but I want to use [dRank] >= 1) instead of 1 how can I do that?
Reply
#5

change with your own loops etc.
PHP Code:
new autogate
Forward
forward close(); 
On the bottom of the gamemode
public 
close() 

MoveObject(autogate,-308.498201508.6586974.33560,3); 
return 
1

Under GameModeInit
autogate CreateObject(987, -308.498201508.6586974.33560,   0.000000.000000.00000); 
Under OnPlayerUpdate
if(
IsPlayerInRangeOfPoint(playerid,8,-308.498201508.6586974.33560)) 
{
If(
PlayerInfo[playerid][pLevel]<2) return SendClientMessage(Playerid,COLOR_RED,"You need to be level 2+"); 
{
MoveObject(autogate,-308.498201508.6586968.10109,3); 
SetTimer("close",4000,0); 
return 
1

Reply
#6

Quote:
Originally Posted by TheLegend1
View Post
change with your own loops etc.
PHP Code:
new autogate
Forward
forward close(); 
On the bottom of the gamemode
public 
close() 

MoveObject(autogate,-308.498201508.6586974.33560,3); 
return 
1

Under GameModeInit
autogate CreateObject(987, -308.498201508.6586974.33560,   0.000000.000000.00000); 
Under OnPlayerUpdate
if(
IsPlayerInRangeOfPoint(playerid,8,-308.498201508.6586974.33560)) 
{
If(
PlayerInfo[playerid][pLevel]<2) return SendClientMessage(Playerid,COLOR_RED,"You need to be level 2+"); 
{
MoveObject(autogate,-308.498201508.6586968.10109,3); 
SetTimer("close",4000,0); 
return 
1

I used this (your code):

PHP Code:
public OnPlayerUpdate(playerid)
{
    if(
PlayerInfo[playerid][dRank]<1) return SendClientMessage(playerid,COLOR_YELLOW,"You need to be DONATOR");
{
    
MoveObject(autogate,-308.498201508.6586968.10109,3);
    
SetTimer("close",4000,0);
    return 
1;
}
    return 
1;

But I get this error:

PHP Code:
C:\Users\Administrator\Desktop\ProjectSvT\gamemodes\SvTMike.pwn(14100) : warning 225unreachable code 
On line 14100 I got this:

PHP Code:
return 1
Reply
#7

Delete it because you got 2 Returns
xD
Reply
#8

it will look like this

PHP Code:
public OnPlayerUpdate(playerid

    if(
PlayerInfo[playerid][dRank]<1) return SendClientMessage(playerid,COLOR_YELLOW,"You need to be DONATOR"); 

    
MoveObject(autogate,-308.498201508.6586968.10109,3); 
    
SetTimer("close",4000,0); 
    return 
1

Reply
#9

Fixed thank you guys
Reply
#10

Np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)