giving gun problem
#1

Hello Guys

First I need to full command of giving gun like

"/sellgun (id) (weaponid)"

Please give me full codes and i will rep you for it
Reply
#2

What type of command format are you using? ZCMD, DCMD, or just regular Command Format?
Reply
#3

ZCMD @RICHARD
Reply
#4

Enjoy! I just got done making your command. (:
Код:
CMD:sellgun(playerid, params[])
{
    new otherid, weaponName;
    new string[64], PlayerName[24];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------------[Guns You Can Sell]--------------------------------");
    SendClientMessage(playerid, COLOR_WHITE, "Level 1: Bat(A-200) | Cane(A-200) | Flowers(A-50) | Katana(A-200) | SDPistol(A-250)");
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------------[Guns You Can Sell]--------------------------------");
    else if(otherid == INVALID_PLAYER_ID) return SendClientMessage(playerid, CHAT_COLOR_RED, "SERVER: Uknown Player ID.");
    else
    {
	if(strcmp(params, "Bat", true, 3))
	{
	     GivePlayerWeapon(otherid, 5, 1);
             SendClientMessage(playerid, CHAT_COLOR_LIGHTBLUE, "Bat works.");
        }
        else if(strcmp(params, "Cane", true, 4))
        {
             GivePlayerWeapon(otherid, 15, 1);
             SendClientMessage(playerid, CHAT_COLOR_LIGHTBLUE, "Cane works.");
        }
        else if(strcmp(params, "Flowers", true, 7))
        {
             GivePlayerWeapon(otherid, 14, 1);
             SendClientMessage(playerid, CHAT_COLOR_LIGHTBLUE, "Flowers works.");
        }
        else if(strcmp(params, "Katana", true, 6))
   	{
             GivePlayerWeapon(otherid, 8, 1);
             SendClientMessage(playerid, CHAT_COLOR_LIGHTBLUE, "Katana works.");
       	}
        else if(strcmp(params, "SDPistol", true, 8))
        {
             GivePlayerWeapon(otherid, 23, 10000);
             SendClientMessage(playerid, CHAT_COLOR_LIGHTBLUE, "SDPistol works.");
     	}
    }
    return 1;
}
Reply
#5

Thanks and Reped but do i need to define the Chat_Colors ?
Reply
#6

The problem is in this line?

Quote:

else if(otherid == INVALID_PLAYER_ID) return SendClientMessage(playerid, CHAT_COLOR_RED, "SERVER: Uknown Player ID.")

;

Quote:

:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Jermi\gamemodes\Gangsta.pwn(622) : error 029: invalid expression, assumed zero
L:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Jermi\gamemodes\Gangsta.pwn(622) : warning 215: expression has no effect
L:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Jermi\gamemodes\Gangsta.pwn(622) : error 001: expected token: ";", but found "if"
L:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Jermi\gamemodes\Gangsta.pwn(622) : error 017: undefined symbol "CHAT_COLOR_RED"
L:\Gta San Andreas\Gta San Andreas\Gta San Andreas\Jermi\gamemodes\Gangsta.pwn(622) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#7

#define CHAT_COLOR_RED #FF0000
at the top of your script, along with other defines.
Reply
#8

So ? help?
Reply
#9

Add that to your script and it should help.
Reply
#10

oh, Color define works but Still the errors but chat color is fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)