/givekey
#2

Here is one i quickly made. It's untested.

pawn Код:
if(!strcmp(cmd,"/givekey",true,8))
    {
        if(Key[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_RED, "You don't have any keys to give.");
            return 1;
        }
        else if(Key[playerid] == 1)
        {
            if(!strlen(cmd[8])) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /givekey [playerid]");
            new otherplayerid = strval(cmdtext[9]);
            if(!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid, 0xAFAFAFAA, "That player isnt connected");
            if(otherplayerid == playerid) return SendClientMessage(playerid, 0xFF0000AA, "You cannot send a key to yourself!");
            new string[128], string2[128];
            new adminname[MAX_PLAYER_NAME], otherguysname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,adminname,sizeof(adminname));
            GetPlayerName(otherplayerid,otherguysname,sizeof(otherguysname));
            format(string,sizeof(string),"** You have given your key to %s", otherguysname);
            format(string2,sizeof(string2),"** You have received a key from to %s", adminname);
            SendClientMessage(playerid, 0x00E100FF, string);
            SendClientMessage(otherplayerid, 0x00E100FF, string2);
            Key[otherplayerid] = 1;
            Key[playerid] = 0;
        }
        return 1;
    }
Reply


Messages In This Thread
/givekey - by retart441 - 08.11.2009, 17:21
Re: /givekey - by member - 08.11.2009, 17:34

Forum Jump:


Users browsing this thread: 1 Guest(s)