Digger.
#1

Can someone give me a clue to make a digger perk for zombie.

i mean that if zombie using digger then teleport zombie to nearest survivour only one time and then after 2 min he can again use that perk.

plz someone help a little bit.
Reply
#2

can anyone help?
Reply
#3

Wait 24 hours before bumping.
Reply
#4

pawn Код:
new lastTPTime[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    lastTPTime[playerid] = 0;
    return 1;
}

CMD:tp(playerid, params[])
{
    if(!IsZombieDigger(playerid))return SendClientMessage(playerid, -1, "You're not the required class of Zombie to do this.");
    if(gettime() < lastTPTime[playerid])return SendClientMessage(playerid, -1, "You can't TP yet.");
   
    new id, Float:x, Float:y, Float:z;
    if(sscanf(params, "u", id))return SendClientMessage(playerid, -1, "Usage: /tp [playerid/name] - This will TP you to a human.");
    {
        if(!IsPlayerConnected(id))return SendClientMessage(playerid, -1, "That player isn't connected.");
        if(!IsHuman(id))return SendClientMessage(playerid, -1, "That player isn't a Human.");
       
        GetPlayerPos(id, x, y, z);
        SetPlayerPos(playerid, x, y-2.0, z);
       
        SendClientMessage(playerid, -1, "You have teleported to a human!");
       
        lastTPTime[playerid] = (gettime() + 120);
    }
    return 1;
}
Here's what you asked for: "i mean that if zombie using digger then teleport zombie to nearest survivour only one time and then after 2 min he can again use that perk."

It's not to the nearest player, but to a player of choice. A bit of research can get the closest player ID.
Reply
#5

Quote:
Originally Posted by iGetty
Посмотреть сообщение
pawn Код:
new lastTPTime[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    lastTPTime[playerid] = 0;
    return 1;
}

CMD:tp(playerid, params[])
{
    if(!IsZombieDigger(playerid))return SendClientMessage(playerid, -1, "You're not the required class of Zombie to do this.");
    if(gettime() < lastTPTime[playerid])return SendClientMessage(playerid, -1, "You can't TP yet.");
   
    new id, Float:x, Float:y, Float:z;
    if(sscanf(params, "u", id))return SendClientMessage(playerid, -1, "Usage: /tp [playerid/name] - This will TP you to a human.");
    {
        if(!IsPlayerConnected(id))return SendClientMessage(playerid, -1, "That player isn't connected.");
        if(!IsHuman(id))return SendClientMessage(playerid, -1, "That player isn't a Human.");
       
        GetPlayerPos(id, x, y, z);
        SetPlayerPos(playerid, x, y-2.0, z);
       
        SendClientMessage(playerid, -1, "You have teleported to a human!");
       
        lastTPTime[playerid] = (gettime() + 120);
    }
    return 1;
}
Here's what you asked for: "i mean that if zombie using digger then teleport zombie to nearest survivour only one time and then after 2 min he can again use that perk."

It's not to the nearest player, but to a player of choice. A bit of research can get the closest player ID.
bro i edited this code a lill but not working.

Quote:

if(strcmp("/dig",cmdtext,true,10)==0) {
if(gTeam[playerid] == TEAM_ZOMBIE)
if(gettime() < lastTPTime[playerid])return SendClientMessage(playerid, -1, "You can't dig right now.");

new id, Float, Float:y, Float:z;
if(sscanf(cmdtext, "u", id))return SendClientMessage(playerid, -1, "Usage: /dig [playerid/name] - This will dig you to a human.");
{
if(!IsPlayerConnected(id))return SendClientMessage(playerid, -1, "That player isn't connected.");
if(gTeam[playerid] == TEAM_HUMAN)
SendClientMessage(playerid, -1, "That player isn't a Human.");

GetPlayerPos(id, x, y, z);
SetPlayerPos(playerid, x, y-2.0, z);

SendClientMessage(playerid, -1, "You have teleported to a human!");

lastTPTime[playerid] = (gettime() + 180);
}
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)