heal command
#2

You try to get the argument of the function like /heal <id>, just make a string compare of cmd text and youre cmd

pawn Код:
if(strcmp("/aheal", cmdtext, true, 6) == 0)
        {
                new temp[128];
                new giveplayerid;
                new giveplayer[MAX_PLAYER_NAME];
                new playername[MAX_PLAYER_NAME];
                new str[128];
                new idx;
                temp = strtok(cmdtext[6], idx);
 
                if(strlen(temp) == 0)
                        {
                                SendClientMessage(playerid, -1, "** [Utilisation]: /aheal [playerid/PartOfName]");
                                return 1;
                        }
                else
                {
                if(IsPlayerpAdmin(playerid))
                {
                    giveplayerid = ReturnUser(temp);
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, playername, sizeof(playername));
                    if(IsPlayerConnected(giveplayerid))
                    {
                        format(str, sizeof(str), "L'admin %s a soignй le joueur %s", playername, giveplayer);
                        SendClientMessageToAll(COLOR_RED, str);
                        return 1;
                    }
                    else SendClientMessage(playerid, -1, "Le joueur n'est pas connectй/n'existe pas");
                    return 1;
                }
                else SendClientMessage(playerid, -1, "Vous n'йtes pas admin.");
                }
                return 1;
    }
Reply


Messages In This Thread
heal command - by lsreskjn - 14.08.2013, 15:53
Re : heal command - by Garwan50 - 14.08.2013, 18:54
Re: heal command - by Edix - 14.08.2013, 19:42

Forum Jump:


Users browsing this thread: 1 Guest(s)