ZombieSetup(targetid); SpawnPlayer(targetid);
|
HumanSetup(targetid); SpawnPlayer(targetid); |
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;
}
|
You'll need YCMD and sscanf. Use the search function to find them. Here is the command:
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;
}
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;
}
maybe u can tell how make textdraw where can see health :P