help please
#1

pawn Код:
if(strcmp(cmd, "/bite", true) ==0)
    {
        if(team[playerid] != 2)
        {
        SendClientMessage(playerid, COLOR_YELLOW, "You dont want to bite people, you are Human.");
            return 1;
        }
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /bite [playerid]");
            return 1;
        }
        if(!IsNumeric(tmp)) target = ReturnPlayerID(tmp); else target = strval(tmp);
        if(GetDistanceBetweenPlayers(playerid,target) > 2)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "Target is to far away.");
            return 1;
        }
        GetPlayerName(target, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(team[playerid] == 2)
        {
        new Float:hp;
          if(team[target] == 1 || team[target] <= 2) return SendClientMessage(playerid,COLOR_RED,"That player is not a human.");
            format(string, sizeof(string), "You were infected by %s.", sendername);
            SendClientMessage(target, COLOR_RED, string);
            format(string, sizeof(string), "You infected %s.", giveplayer);
            SendClientMessage(playerid, COLOR_GREEN, string);
            GameTextForPlayer(target, "Infected!", 2500, 3);
            SendClientMessage(target, COLOR_RED, "You have been infected! Get to the hospital for the antidote! ");
            SendClientMessage(target, COLOR_YELLOW, "Reach the red checkpoint before you die and become a zombie. ");
            SetPlayerCheckpoint(target, 1606.983154, 1822.565551, 10.820312, 8.0);
            infected[target] = 1;
            GetPlayerHealth(target,hp);
            SetPlayerHealth(playerid, 100);
            GameTextForPlayer(target, "~r~YOU ARE INFECTED!!!", 2500, 3);
            GameTextForPlayer(playerid, "~g~BITE (HEAL)!", 2500, 3);
        }
        return 1;
    }
every time we type /bite [playerid] it just pulls up the usage all the time help please?
Reply
#2

Obviously the problem is where you defined tmp, not in the command.
Reply
#3

haha lol i cant help but what GM do you have? :P and why do you want to bite? XD
Reply
#4

Quote:
Originally Posted by Baked-Banana
Obviously the problem is where you defined tmp, not in the command.
well where should I put it?
Reply
#5

Assuming you're using strtok..
pawn Код:
tmp = strtok(cmdtext, idx);
Put that right before:
pawn Код:
if(!strlen(tmp))
Reply
#6

Quote:
Originally Posted by Grim_
Assuming you're using strtok..
pawn Код:
tmp = strtok(cmdtext, idx);
Put that right before:
pawn Код:
if(!strlen(tmp))
It works thanks you sexy beast xD
Reply
#7

No problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)