Can help ?
#1

Hi everyone sorry for bad english.
Can you help me ? i need make command that all id's make a human just one id make zombie
like /setzm [ID]
other will be human
i'm using apocalypse mode here is scripts that make human and zombie
Код:
ZombieSetup(targetid);
SpawnPlayer(targetid);
and human
Quote:

HumanSetup(targetid);
SpawnPlayer(targetid);

Then i need command that makes player health like 1000 and its rlly hard to kill him.
Thanks for help,who gonna help me
Reply
#2

You'll need YCMD and sscanf. Use the search function to find them. Here is the command:
pawn Код:
YCMD:setzm(playerid, params[], help)
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))//this will work only for rcon admins, change it to your admin variable
    {
        new recid;
        if(sscanf(params, "u", recid)) return SCM(playerid, 0xFF0000FF, "USAGE : /setzm [player id/name]");
        else
        {
            ZombieSetup(recid);
            SpawnPlayer(recid);
            SCM(playerid, 0xFF0000FF, "You're a zombie!");//change the message
            SetPlayerHealth(recid, 1000);//so it's going to be hard to kill him
        }
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by DiGiTaL_AnGeL
Посмотреть сообщение
You'll need YCMD and sscanf. Use the search function to find them. Here is the command:
pawn Код:
YCMD:setzm(playerid, params[], help)
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))//this will work only for rcon admins, change it to your admin variable
    {
        new recid;
        if(sscanf(params, "u", recid)) return SCM(playerid, 0xFF0000FF, "USAGE : /setzm [player id/name]");
        else
        {
            ZombieSetup(recid);
            SpawnPlayer(recid);
            SCM(playerid, 0xFF0000FF, "You're a zombie!");//change the message
            SetPlayerHealth(recid, 1000);//so it's going to be hard to kill him
        }
    }
    return 1;
}
This is that i chose one id that will be zombie other will be humans ?
Like:
i chose 2 ID
and 0,1,3,4,5,6,7,8,9,10 will be humans ?
Reply
#4

No, only the id you'll select will be a zombie. I hadn't read well.
Reply
#5

Huh,i hawe that command for zombie set i need the another id's to be humans.In my server are auto selector so i need whit 1command make all
Reply
#6

pawn Код:
CMD:setzm(playerid, params[], help) //Credit to  DiGiTaL_AnGeL
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))//this will work only for rcon admins, change it to your admin variable
    {
        new recid;
        if(sscanf(params, "u", recid)) return SCM(playerid, 0xFF0000FF, "USAGE : /setzm [player id/name]");
        else
        {
            ZombieSetup(recid);
            SpawnPlayer(recid);                    
            SCM(recid, 0xFF0000FF, "You're a zombie!");//change the message
            SetPlayerHealth(recid, 1000);//so it's going to be hard to kill him
       
            foreach(new i : Player)
        {
          if(IsPlayerConnected(i))
              {
               if(recid != i)
               {
                HumanSetup(i);
                SpawnPlayer(i);
                SCM(i, 0xFF0000FF, "You're a human!");//change the message
                SetPlayerHealth(i, 100);
               }

              }

            }
           
        }
    }
    return 1;
}
Reply
#7

remove #pragma unused params because you actually use the params , lol (sscanf).

also, the IsPlayerConnected check in foreach isn't necessary as it checks automaticlly.

pawn Код:
command(setzm, playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new recid;
        if(sscanf(params, "u", recid)) return SCM(playerid, -1, "USAGE : /setzm [player id/name]");
        if(recid == INVALID_PLAYER_ID) return SCM(playerid, -1, "Invalid user id.")
        ZombieSetup(recid);
        SpawnPlayer(recid);                    
        SCM(recid, -1, "You're a zombie!");
        SetPlayerHealth(recid, 1000);
        foreach(new i : Player)
        {
            if(recid != i)
            {
                HumanSetup(i);
                SpawnPlayer(i);
                SCM(i, -1, "You're a human!");
                SetPlayerHealth(i, 100);
            }

        }
    }
    return 1;
}
You'll need sscanf, foreach and zcmd for that.
Reply
#8

Thx guys maybe u can tell how make textdraw where can see health :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)