/setage
#1

How do it /setage 1-99 ?

Код:
if(strcmp(cmd, "/setage", true) == 0)
{

return 1;
}
PlayerInfo[i] or [playerid]
PlayerInfo[i][pAge] = ....;
Example:
PlayerInfo[playerid][pAge] = 20;

I Need It, For RP Server.
Reply
#2

use dcmd
Reply
#3

Quote:
Originally Posted by brett7
use dcmd
What is dcmd ? Im not proffesional scripter
Help! Please code.
Reply
#4

Код:
	if(strcmp(cmd, "/mддravanus", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KASUTUS: /mддravanus [vanus]");
				return 1;
			}
			new playa;
			new age;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			age = strval(tmp);
			if(IsPlayerConnected(playa))
			{
				if(playa != INVALID_PLAYER_ID)
				{
					PlayerInfo[playa][pAge] = age;
					GetPlayerName(playa, giveplayer, sizeof(giveplayer));
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, 256, "SERVER: Sa oled nььd %d vanus!", age);
					SendClientMessage(COLOR_YELLOW,string,1);
				}
			}
		}
		return 1;
	}

Mддravanus = Setage (Estonian - English)

How do it, like:

/mддravanus 18

not /mддravanus [id] 18

(id/playername) need to remove,
Thanks

Reply
#5

pawn Код:
if(strcmp(cmd, "/mддravanus", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "KASUTUS: /mддravanus [vanus]");
                return 1;
            }
            new age;
            tmp = strtok(cmdtext, idx);
            age = strval(tmp);
            if(IsPlayerConnected(playa))
            {
                PlayerInfo[playerid][pAge] = age;
                format(string, 256, "SERVER: Sa oled nььd %d vanus!", age);
                SendClientMessage(COLOR_YELLOW,string,1);
                }
            }
        }
        return 1;
    }
Reply
#6

Please too, like

/mддravanus 1-99
Minium 1 and Maxium 99
Reply
#7

Is correct?:

Код:
	if(strcmp(cmd, "/mддravanus", true) == 0)
	{
		age = strval(tmp);
		if(age < 1 || age > 99)
		{
		  SendClientMessage(playerid, COLOR_GRAD1, "Vanus peab olema 1-99!");
		  return 1;
		}
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KASUTUS: /mддravanus [vanus]");
				return 1;
			}
			new age;
			tmp = strtok(cmdtext, idx);
			age = strval(tmp);
			if(IsPlayerConnected(playa))
			{
				PlayerInfo[playerid][pAge] = age;
				format(string, 256, "SERVER: Sa oled nььd %d vanus!", age);
				SendClientMessage(COLOR_YELLOW,string,1);
				}
			}
		}
		return 1;
	}
Srry dp
Reply
#8

Try it..
Reply
#9

Cant, Pawno library compiler has stopped work...
Reply
#10

pawn Код:
if(strcmp(cmd, "/mддravanus", true) == 0)
    {
        age = strval(tmp);
        if(age < 1 || age > 99)
        {
          SendClientMessage(playerid, COLOR_GRAD1, "Vanus peab olema 1-99!");
          return 1;
        }
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "KASUTUS: /mддravanus [vanus]");
                return 1;
            }
            new age;
            tmp = strtok(cmdtext, idx);
            age = strval(tmp);
            if(IsPlayerConnected(playa))
            {
                PlayerInfo[playerid][pAge] = age;
                format(string, 256, "SERVER: Sinu uueks vanuseks on %d.", age);
                SendClientMessage(COLOR_YELLOW,string,1);
            }
        }
        return 1;
    }
Ьks ьleliigne ' } '.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)