SA-MP Forums Archive
Help[rep] - 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[rep] (/showthread.php?tid=314999)



Help[rep] - Dan_Barocu - 01.02.2012

i tried to make a CMD like this /levelup

ad when i type the whole server gets an level up!please help i tried and then i deleted it by mistake!


Re: Help[rep] - fiki574 - 01.02.2012

pawn Код:
//Put this under /levelup command
for(new i=0; i < MAX_PLAYERS; i++)
{
      //level up function, example:
      LevelUp(i); //this will level up all players in server, which are "marked" with "i"
}



Re: Help[rep] - Dan_Barocu - 01.02.2012

i made this please fix it

Код:
 //-------------------------------[LevelUp]--------------------------------------------------------------------------
				if (strcmp(cmd, "/levelupall", true) == 0)
				{
				    if(IsPlayerConnected(playerid))
				    {
                        if(PlayerInfo[playerid][pAdmin] >= 1337)
					    {
						    if (gPlayerLogged[playerid] != 0)
						    {
                            for(new i=0; i < MAX_PLAYERS; i++)
						    {
      						//level up function, example:
      						LevelUp(i); //this will level up all players in server, which are "marked" with "i"
						}



Re: Help[rep] - fiki574 - 01.02.2012

pawn Код:
if(strcmp(cmd, "/levelupall", true) == 0)
{
     if(IsPlayerConnected(playerid))
     {
           if(PlayerInfo[playerid][pAdmin] >= 1337)
           {
               if(gPlayerLogged[playerid] == 1)
               {
                      for(new i=0; i < MAX_PLAYERS; i++)
                       {
                            //level up function
                       }
               }
           }
     }
     return 1;
}



Re: Help[rep] - Konstantinos - 01.02.2012

By levelup means their Admin Level?
If yes, then use it as fiki posted above.
pawn Код:
if(strcmp(cmd, "/levelupall", true) == 0)
{
     if(IsPlayerConnected(playerid))
     {
           if(PlayerInfo[playerid][pAdmin] >= 1337)
           {
               if(gPlayerLogged[playerid] == 1)
               {
                      for(new i=0; i < MAX_PLAYERS; i++)
                       {
                            PlayerInfo[i][pAdmin] ++;
                       }
               }
           }
     }
     return 1;
}



Re: Help[rep] - 2KY - 01.02.2012

pawn Код:
if (strcmp(cmd, "/levelupall", true) == 0)
{
    if(PlayerInfo[playerid][pAdmin] >= 1337)
    {
        if (gPlayerLogged[playerid] != 0)
        {
            for(new g_Players = 0; g_Players < MAX_PLAYERS; g_Players++)
            {
                //Your level up function, if you're using Godfather, which I'm assuming you are:
                PlayerInfo[g_Players][pLevel]++;
        }
        else return 0; //Not logged in.
    }
    else return 0; //Not authorized to use this.
    return 1;
}



Re: Help[rep] - Dan_Barocu - 01.02.2012

how come i get no level up?


Re: Help[rep] - Dan_Barocu - 01.02.2012

Quote:
Originally Posted by fiki574_CRO
Посмотреть сообщение
pawn Код:
//Put this under /levelup command
for(new i=0; i < MAX_PLAYERS; i++)
{
     //level up function, example:
     (36671) LevelUp(i); //this will level up all players in server, which are "marked" with "i"
}

(36671) : error 017: undefined symbol "LevelUp"


Re: Help[rep] - Dan_Barocu - 01.02.2012

Код:
 if (strcmp(cmd, "/lvlup", true) == 0)
				{
     			    if(IsPlayerConnected(playerid))
     				{
           			    if(PlayerInfo[playerid][pAdmin] >= 1337)
           				{
               			if(gPlayerLogged[playerid] == 1)
               			{
                      	for(new i=0; i < MAX_PLAYERS; i++)
                       	{
                            PlayerInfo[i][pAdmin] ++;
                       	}
               		 }
           		   }
			    }
    			return 1;
				}
i want to appear a message in sendclientmessage Thank you for staying on our server!+ i get no level up!


Re: Help[rep] - fiki574 - 01.02.2012

Quote:
Originally Posted by Dan_Barocu
Посмотреть сообщение
Код:
 if (strcmp(cmd, "/lvlup", true) == 0)
				{
     			    if(IsPlayerConnected(playerid))
     				{
           			    if(PlayerInfo[playerid][pAdmin] >= 1337)
           				{
               			if(gPlayerLogged[playerid] == 1)
               			{
                      	for(new i=0; i < MAX_PLAYERS; i++)
                       	{
                            PlayerInfo[i][pAdmin] ++;
                       	}
               		 }
           		   }
			    }
    			return 1;
				}
i want to appear a message in sendclientmessage Thank you for staying on our server!+ i get no level up!
Did u read my post above

Go to SAMP Wiki and/or look for tutorials here on forums!