SA-MP Forums Archive
What the wrong here? - 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: What the wrong here? (/showthread.php?tid=624441)



What the wrong here? - RedRex - 16.12.2016

Help me Plesae when I go Robbery anything i'll got all weapons From checkpoints so what to do For fix this?

PHP код:
public OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == SWAT)
    if(
GetPlayerSkin(playerid) != 285) return SendClientMessage(playerid, -1"{FF0000}Sorry This Place only For SWAT, you are not SWAT");
    {
    
GivePlayerWeapon(playerid2465);
    
GivePlayerWeapon(playerid26150);
    
GivePlayerWeapon(playerid31150);
    
GivePlayerWeapon(playerid3450);
    
SetPlayerArmour(playerid100);
    
SetPlayerHealth(playerid100);
    
SendClientMessage(playerid, -1"{FF0000}You have been Refill Come Back After you Dead");
    
GameTextForPlayer(playerid"You have been Refiled!!"40005); //It will show this if a player steps in the checkpoint
    
return 1;
    }
    if(
checkpointid == COPS[1])
    if(
GetPlayerSkin(playerid) != 287) return SendClientMessage(playerid, -1"{FF0000}Sorry This Place Only For Army, you are not army");
    {
    
GivePlayerWeapon(playerid2765);
    
GivePlayerWeapon(playerid30100);
    
GivePlayerWeapon(playerid2465);
    
GivePlayerWeapon(playerid163);
    
GivePlayerWeapon(playerid29250);
    
SetPlayerArmour(playerid75.00);
    
GameTextForPlayer(playerid"~g~Refild"40005);
    
SendClientMessage(playerid, -1"{FF0000}You have been Refiled Come Back After you Dead");
    return 
1;
    }
    if(
checkpointid == ARMY[2])
    if(
GetPlayerSkin(playerid) != 280) return SendClientMessage(playerid, -1"{FF0000}Sorry This Place only for Police Offier, You are not Police");
    {
    
GivePlayerWeapon(playerid2437);
    
GivePlayerWeapon(playerid3330);
    
GivePlayerWeapon(playerid29150);
    
GivePlayerWeapon(playerid3035);
    return 
1;
    }
    if(
checkpointid == MDEIC[3])
    if(
GetPlayerSkin(playerid) == 277) return SendClientMessage(playerid, -1"{FF0000}Sorry This Refill only for Firefighter, You are not FireMan");
    {
    
GivePlayerWeapon(playerid4299999);
    
SendClientMessage(playerid, -1"{FF0000}You have been Refiled, Come Back After you Dead");
    
GameTextForPlayer(playerid"~g~Refiled"40005);
    return 
1;
    }

Is there anything not done? Please Check the CASE If worked or not..


Re: What the wrong here? - Runn3R - 16.12.2016

You are missing the opening and closing brackets on the if statements. ( tbe "{" "}" )


Re: What the wrong here? - RedRex - 16.12.2016

Quote:
Originally Posted by Runn3R
Посмотреть сообщение
You are missing the opening and closing brackets on the if statements. ( tbe "{" "}" )
What do you mean? can u understand me? or give me more info or Example?

EDITED: ( tbe "{" "}" ) ?? What do you mean of it


Re: What the wrong here? - Runn3R - 16.12.2016

pawn Код:
if(somevar == someval)
{
}



Re: What the wrong here? - RedRex - 16.12.2016

Sorry man, still not work....


Re: What the wrong here? - Thanks - 16.12.2016

You should use return 1; ?


Re: What the wrong here? - iLearner - 16.12.2016

I wouldn't return anything at the end...

Where are you handling the robbery cp?