Barman work command
#1

I want to make something but i don't know if thais is possible, i want to make a command that will give beer to other people, for excable someone is in the bar of zizzy's like barman and want to give a beer in other player, typing /givebeer [player id], and then a beer will appear to the id player, can i make this
Reply
#2

pawn Код:
CMD:givebeer(playerid, params[])
{
    new uid;

    if(sscanf(params, "u", uid))
        return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /givebeer <playerid/partofname>");

    if(uid == INVALID_PLAYER_ID)
        return SendClientMessage(playerid, COLOR_YELLOW, "Player not connected.");

    SetPlayerSpecialAction(uid, SPECIAL_ACTION_DRINK_BEER);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
CMD:givebeer(playerid, params[])
{
    new uid;

    if(sscanf(params, "u", uid))
        return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /givebeer <playerid/partofname>");

    if(uid == INVALID_PLAYER_ID)
        return SendClientMessage(playerid, COLOR_YELLOW, "Player not connected.");

    SetPlayerSpecialAction(uid, SPECIAL_ACTION_DRINK_BEER);
    return 1;
}
i don't use CMD
Reply
#4

LOL!!
Reply
#5

LOL xD, I tried to make it in this way, but doesn't work, and all my other commands stop to work xD, But i didn't get errors in compile:

Код:
        new giveplayerid;
        new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	if (strcmp("/giveit", cmdtext, true, 10) == 0)
	{
	 	if (IsPlayerConnected(giveplayerid))
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_DRINK_BEER);
	}
	else
	{
        SendClientMessage(playerid, 0xFFFF00AA, "Invalid transaction amount.");
		return 1;
	}
Tell me what i did wrong, what i miss, and what i must do? (sorry guys, i am a noob xD)
Reply
#6

Quote:
Originally Posted by NitoPSG
Посмотреть сообщение
LOL xD, I tried to make it in this way, but doesn't work, and all my other commands stop to work xD, But i didn't get errors in compile:

Код:
        new giveplayerid;
        new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	if (strcmp("/giveit", cmdtext, true, 10) == 0)
	{
	 	if (IsPlayerConnected(giveplayerid))
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_DRINK_BEER);
	}
	else
	{
        SendClientMessage(playerid, 0xFFFF00AA, "Invalid transaction amount.");
		return 1;
	}
Tell me what i did wrong, what i miss, and what i must do? (sorry guys, i am a noob xD)
Any help? :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)