score help
#1

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
     if(dialogid == DIALOG_CLASSELECT)
    {
        if(response) // If they clicked 'Yes' or pressed enter
        {
            //Class Selection
            if(listitem == 0) //Soldier
            {
                gPlayerClass[playerid] = SOLDIER;
                TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 31, 200);//m4
        GivePlayerWeapon(playerid, 29, 250);//mp5
        GivePlayerWeapon(playerid, 24, 70);//deagle
        SendClientMessage(playerid, COLOR_WHITE, "You chose the Soldier as your class.");
       
            }
            if(GetPlayerScore(playerid) >=300)return SendClientMessage(playerid,COLOR_RED,"[SERVER]{FFFFFF}You need to be atleast Rank 2");
               {                                 
            if(listitem == 1) //Sniper
            {
               gPlayerClass[playerid] = SNIPER;
               TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 34, 250);//sniper
        GivePlayerWeapon(playerid, 29, 250);//mp5
        GivePlayerWeapon(playerid, 4, 1);//knife
        GivePlayerWeapon(playerid, 23,70);//Silence Pistol
        SendClientMessage(playerid, COLOR_WHITE, "You chose the Sniper as your class.");
        SendClientMessage(playerid, COLOR_WHITE, "You Spawn with a Sniper Rifle at Spawn.");
        SendClientMessage(playerid, COLOR_WHITE, "You are now invisible on the map.Happy Sniping!");
           }
               }
im sniper class i wrote "
if(GetPlayerScore(playerid) >=300)return SendClientMessage(playerid,COLOR_RED,"[SERVER]{FFFFFF}You need to be atleast Rank 2");"

but this is not working and i can choose sniper class with 0 score
Reply
#2

pawn Код:
if(GetPlayerScore(playerid) >=300)return SendClientMessage(playerid,COLOR_RED,"[SERVER]{FFFFFF}You need to be atleast Rank 2");
Try changing the >=300 to just >300 like this cause using "=" is for a specific number I think O.o I most prob am wrong,but there may be a chance I am right,so try this instaid
pawn Код:
if(GetPlayerScore(playerid) >300)return SendClientMessage(playerid,COLOR_RED,"[SERVER]{FFFFFF}You need to be atleast Rank 2");
Reply
#3

No.
pawn Код:
if(GetPlayerScore(playerid) >= 300)
{
SendClientMessage(playerid, COLOR_RED, "[SERVER]{FFFFFF}You must be at least rank 2");
return 1;
}
But that means if they're score it's over 300 you can't choose the sniper class, that's what you wanted to do?
But you need to put that after if(listitem == 1) otherwise it will not work
Reply
#4

Quote:
Originally Posted by Smokeyy
Посмотреть сообщение
No.
pawn Код:
if(GetPlayerScore(playerid) >= 300)
{
SendClientMessage(playerid, COLOR_RED, "[SERVER]{FFFFFF}You must be at least rank 2");
return 1;
}
^_^
pawn Код:
if(GetPlayerScore(playerid) >= 300)
This means if the score = bigger than 300 its going to return the message,you must be rank 2....
it needs to be <=300
so if the score = smaller than 300 it will return the message else if 300+ it will give you the rank
Reply
#5

Thanks i understood the concept working like a charm
+rep
Rep me back too
Reply
#6

Quote:
Originally Posted by NinjahZ
Посмотреть сообщение
^_^
pawn Код:
if(GetPlayerScore(playerid) >= 300)
This means if the score = bigger than 300 its going to return the message,you must be rank 2....
it needs to be <=300
so if the score = smaller than 300 it will return the message else if 300+ it will give you the rank
did u just -rep me ?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)