SA-MP Forums Archive
[HELP] Expression has no effect fast fast - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Expression has no effect fast fast (/showthread.php?tid=519687)



[HELP] Script not work - Multipossa - 15.06.2014

Code:
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(278) : warning 215: expression has no effect
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(278) : error 001: expected token: ";", but found ")"
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(282) : warning 215: expression has no effect
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(290) : warning 215: expression has no effect
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(297) : warning 215: expression has no effect
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(304) : warning 215: expression has no effect
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(317) : warning 215: expression has no effect
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(324) : warning 215: expression has no effect
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(330) : warning 215: expression has no effect
C:\Users\Worker\Desktop\server\filterscripts\cosbase.pwn(336) : warning 215: expression has no effect
Code:
public coson(playerid)

{
for(playerid < MAX_PLAYERS; playerid++)
{
if(IsPlayerInRangeOfPoint(playerid, 8.0, 3623.3948,-338.8084,5.8228)&& DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
{
flag == 1;
MoveDynamicObject(c, 3623.00293, -338.80359, 13, 10);
}


if(IsPlayerInRangeOfPoint(playerid, 8.0, 3632.3701,-339.4589,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
{
SetDynamicObjectRot(tr1, 0, 90, 179.9398);
flag == 2;
}

if(IsPlayerInRangeOfPoint(playerid, 8.0, 3674.54150, -358.16077,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
{

SetDynamicObjectRot(tr2, 0, 90, 179.9999);
flag == 3;
}

if(IsPlayerInRangeOfPoint(playerid, 8.0, 3716.73462, -320.60251,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
{

SetDynamicObjectRot(tr3, 0, 90, 179.9398);
flag == 4;
}
}
return 1;
}
pls help me fast


Re: [HELP] Expression has no effect fast fast - RenovanZ - 15.06.2014

Change this:
pawn Code:
flag == 1;
flag == 2;
//and so on
To:
pawn Code:
flag = 1;
flag = 2;



Re: [HELP] Expression has no effect fast fast - Multipossa - 15.06.2014

C:\Users\Worker\Desktop\server\filterscripts\cosba se.pwn(27 : warning 215: expression has no effect
C:\Users\Worker\Desktop\server\filterscripts\cosba se.pwn(27 : error 001: expected token: ";", but found ")"


Re: [HELP] Expression has no effect fast fast - RenovanZ - 15.06.2014

Show your code on lines 278


Re: [HELP] Expression has no effect fast fast - NewerthRoleplay - 15.06.2014

Quote:
Originally Posted by RenovanZ
View Post
Change this:
pawn Code:
flag == 1;
flag == 2;
//and so on
To:
pawn Code:
flag = 1;
flag = 2;
You should also say why this occurs, which for future reference is because == is comparing the variable to another value and a single equals sign sets the variable.


Re: [HELP] Expression has no effect fast fast - Multipossa - 15.06.2014

Code:
public coson(playerid)

{
for(playerid < MAX_PLAYERS; playerid++)// 278
{
if(IsPlayerInRangeOfPoint(playerid, 8.0, 3623.3948,-338.8084,5.8228)&& DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
{
flag = 1;
MoveDynamicObject(c, 3623.00293, -338.80359, 13, 10);
}


if(IsPlayerInRangeOfPoint(playerid, 8.0, 3632.3701,-339.4589,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
{
SetDynamicObjectRot(tr1, 0, 90, 179.9398);
flag = 2;
}

if(IsPlayerInRangeOfPoint(playerid, 8.0, 3674.54150, -358.16077,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
{

SetDynamicObjectRot(tr2, 0, 90, 179.9999);
flag = 3;
}

if(IsPlayerInRangeOfPoint(playerid, 8.0, 3716.73462, -320.60251,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
{

SetDynamicObjectRot(tr3, 0, 90, 179.9398);
flag = 4;
}
}
return 1;
}
line 278 is for(playerid < MAX_PLAYERS; playerid++)


Re: [HELP] Expression has no effect fast fast - RenovanZ - 15.06.2014

Why you loop it as you have playerid parameter already ?
Just delete it, like this:
pawn Code:
public coson(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 8.0, 3623.3948,-338.8084,5.8228)&& DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
    {
        flag = 1;
        MoveDynamicObject(c, 3623.00293, -338.80359, 13, 10);
    }
    if(IsPlayerInRangeOfPoint(playerid, 8.0, 3632.3701,-339.4589,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
    {
        SetDynamicObjectRot(tr1, 0, 90, 179.9398);
        flag = 2;
    }
    if(IsPlayerInRangeOfPoint(playerid, 8.0, 3674.54150, -358.16077,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
    {
        SetDynamicObjectRot(tr2, 0, 90, 179.9999);
        flag = 3;
    }
    if(IsPlayerInRangeOfPoint(playerid, 8.0, 3716.73462, -320.60251,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 0)
    {  
        SetDynamicObjectRot(tr3, 0, 90, 179.9398);
        flag = 4;
    }
    return 1;
}
Also watch your identation, use TAB in your PAWNO.


Re: [HELP] Expression has no effect fast fast - Multipossa - 15.06.2014

But does not work with all players


Re: [HELP] Expression has no effect fast fast - RenovanZ - 15.06.2014

pawn Code:
public coson(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 8.0, 3623.3948,-338.8084,5.8228)&& DoesPlayerHasTag(i,"[cos")&& flag == 0)
        {
            flag = 1;
            MoveDynamicObject(c, 3623.00293, -338.80359, 13, 10);
        }  
        if(IsPlayerInRangeOfPoint(i, 8.0, 3632.3701,-339.4589,5.8228)&& !DoesPlayerHasTag(i,"[cos")&& flag == 0)
        {
            SetDynamicObjectRot(tr1, 0, 90, 179.9398);
            flag = 2;
        }
        if(IsPlayerInRangeOfPoint(i, 8.0, 3674.54150, -358.16077,5.8228)&& !DoesPlayerHasTag(i,"[cos")&& flag == 0)
        {
            SetDynamicObjectRot(tr2, 0, 90, 179.9999);
            flag = 3;
        }
        if(IsPlayerInRangeOfPoint(i, 8.0, 3716.73462, -320.60251,5.8228)&& !DoesPlayerHasTag(i,"[cos")&& flag == 0)
        {  
            SetDynamicObjectRot(tr3, 0, 90, 179.9398);
            flag = 4;
        }
        return 1;
    }
}



Re: [HELP] Expression has no effect fast fast - Multipossa - 15.06.2014

the complete script is:
PHP Code:
public coson(playerid)
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerInRangeOfPoint(i8.03623.3948,-338.8084,5.8228)&& DoesPlayerHasTag(i,"[cos")&& flag == 0)
        {
            
flag 1;
            
MoveDynamicObject(c3623.00293, -338.803591310);
        }
        if(
IsPlayerInRangeOfPoint(i8.03632.3701,-339.4589,5.8228)&& !DoesPlayerHasTag(i,"[cos")&& flag == 0)
        {
            
SetDynamicObjectRot(tr1090179.9398);
            
flag 2;
        }
        if(
IsPlayerInRangeOfPoint(i8.03674.54150, -358.16077,5.8228)&& !DoesPlayerHasTag(i,"[cos")&& flag == 0)
        {
            
SetDynamicObjectRot(tr2090179.9999);
            
flag 3;
        }
        if(
IsPlayerInRangeOfPoint(i8.03716.73462, -320.60251,5.8228)&& !DoesPlayerHasTag(i,"[cos")&& flag == 0)
        {
            
SetDynamicObjectRot(tr3090179.9398);
            
flag 4;
        }
        return 
1;
    }
    return 
0;
}
public 
cosoff(playerid)
{
for(new 
0MAX_PLAYERSi++)
{
if(!
IsPlayerInRangeOfPoint(playerid8.03623.3948,-338.8084,5.8228)&& DoesPlayerHasTag(playerid,"[cos")&& flag == 1)
{
flag 0;
MoveDynamicObject(c3623.00293, -338.803597.5884710);
}
if(!
IsPlayerInRangeOfPoint(playerid8.03632.3701,-339.4589,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 2)
{
flag 0;
SetDynamicObjectRot(tr100179.9398);
}
if(!
IsPlayerInRangeOfPoint(playerid8.03674.54150, -358.16077,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 3)
{
flag 0;
SetDynamicObjectRot(tr200179.9999);
}
if(!
IsPlayerInRangeOfPoint(playerid8.03716.73462, -320.60251,5.8228)&& !DoesPlayerHasTag(playerid,"[cos")&& flag == 4)
{
flag 0;
SetDynamicObjectRot(tr300179.9398);
}
return 
1;
}
return 
0;

and isn't work with all player, help me!!