Help Please.
#1

Hello SA-MP'ers.
I need your help.
Today i tried making an Rank system for my upcomming TDM Server.
But i got stucked..How would i differenciate between an Normal Player and Donater.


I setted different hp and armor for each rank...But how do i make donater different from them ?
When a donater spawn..instead of getting full stuff..He only get the armor setted for the rank.
My code.

pawn Код:
switch (PlayerInfo[playerid][pDonateRank])
    {
        case 1:
        {
            SetPlayerHealth(playerid,100);
            SetPlayerArmour(playerid, 50);
            dlabel[playerid] = Create3DTextLabel("V.I.P", COLOR_YELLOW,0,0,0,40,0);
            Attach3DTextLabelToPlayer(dlabel[playerid], playerid, 0.0, 0.0, 0.0);
        }
        case 2:
        {
            SetPlayerHealth(playerid,100);
            SetPlayerArmour(playerid, 100);
            dlabel[playerid] = Create3DTextLabel("Gold V.I.P", COLOR_YELLOW,0,0,0,40,0);
            Attach3DTextLabelToPlayer(dlabel[playerid], playerid, 0.0, 0.0, 0.0);
The above one is for Donater..Its under OnPlayerSpawn..

And the one for rank.
pawn Код:
public OnPlayerUpdate(playerid)
{
    new str[256];
    format(str,sizeof(str),"~r~Kills: ~w~%d ~g~Deaths: ~w~%d",Killss[playerid],Deaths[playerid]);
    TextDrawSetString(Text:Stats[playerid],str);
    if(Kills[playerid]<10)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Newbie Shooter");
    SetPlayerHealth(playerid, 40);

    }
    else if(Kills[playerid]<25 && Kills[playerid]>=10)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Killer Shooter");
    SetPlayerHealth(playerid, 60);

    }
    else if(Kills[playerid]<75 && Kills[playerid]>=25)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Master Shooter");
    SetPlayerHealth(playerid, 80);

    }
    else if(Kills[playerid]<150 && Kills[playerid]>=300)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Pro Shooter");
    SetPlayerHealth(playerid, 90);

    }
    else if(Kills[playerid]<300 && Kills[playerid]>=450)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Striker Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 5);


    }
    else if(Kills[playerid]<450 && Kills[playerid]>= 675)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Freekill Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 10);

    }
    else if(Kills[playerid]<675 && Kills[playerid]>= 1000)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Psycho Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 15);

    }
    else if(Kills[playerid]<1000 && Kills[playerid]>= 1500)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Fatal Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 20);
    }
    else if(Kills[playerid]<1500 && Kills[playerid]>= 2250)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Havoc Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 25);
    }
    else if(Kills[playerid]<2250 && Kills[playerid]>= 3375)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Extreme Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 30);
    }
    else if(Kills[playerid]<3375 && Kills[playerid]>= 5100)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Wild Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 35);
    }
    else if(Kills[playerid]<5100 && Kills[playerid]>= 7650)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Hazardous Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 40);
    }
    else if(Kills[playerid]<7650 && Kills[playerid]>= 11475)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~IGI Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 45);                                                                                                                                                                 /*Scripted By Sufyan*/
    }
    else if(Kills[playerid]<11475 && Kills[playerid]>= 17500)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Tactical Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 50);
    }
    else if(Kills[playerid]<17500 && Kills[playerid]>= 26250)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Dedicated Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 55);
    }
    else if(Kills[playerid]<26250 && Kills[playerid]>= 39375)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Insane Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 60);
    }
    else if(Kills[playerid]<39375 && Kills[playerid]>= 60000)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~The Real Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 65);
    }
    else if(Kills[playerid]<60000 && Kills[playerid]>= 100000)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Professional Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 70);
    }
    else if(Kills[playerid]> 100000)
    {
    TextDrawSetString(Text:Ranktext[playerid],"~r~RANK:~w~Rockstar Shooter");
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 80);
    }



    return 1;
}
But when i spawn as a donater and rank 1 ofc [ new acc]..I get half armor..Can you help with the code please...I am stucked in it :/
Reply
#2

onplayerspawn add it
Reply
#3

You mean using Rank and Donater under OnPlayerSpawn ?
Or i guess i need to use If else statement with it ?
Reply
#4

well u see if u use those lines on player spawn then it will set the player relevant info REP++ plz
Reply
#5

You are using OnPlayerUpdate wich will call that script every second this will make everyone god mod, I suggest you to add the kill and stuff within onplayerspawn and before the rank script otherwise you should add exceptions with the kills
Reply
#6

@Naruto.
So you mean i should use Rank system and Donater @OnPlayerSpawn callback ?
Reply
#7

Quote:
Originally Posted by Gaurav_Rawat
Посмотреть сообщение
@Naruto.
So you mean i should use Rank system and Donater @OnPlayerSpawn callback ?
Yes becose after player die OnPlayerSpawn function will be called
Reply
#8

Nope it didn't worked.
Seems like i need to add Exception only xD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)