#1

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>

new Menu:weaponmenu;

#define LIGHT_BLUE 0x33CCFFAA

public OnFilterScriptInit()
{

        weaponmenu = CreateMenu("Weapon Menu", 1, 220.0, 100.0, 150.0, 150.0);
        AddMenuItem(weaponmenu, 0, "9mm Weapon     500");
        AddMenuItem(weaponmenu, 0, "Silenced 9mm Weapon   500");
        AddMenuItem(weaponmenu, 0, "Desert Eagle Weapon   500");
        AddMenuItem(weaponmenu, 0, "Shotgun Weapon   700");
        AddMenuItem(weaponmenu, 0, "Sawnoff Shotgun Weapon   1000");
        AddMenuItem(weaponmenu, 0, "Combat Shotgun Weapon   600");
        AddMenuItem(weaponmenu, 0, "Micro SMG (Uzi)Weapon   600");
        AddMenuItem(weaponmenu, 0, "M4 Weapon");
        AddMenuItem(weaponmenu, 0, "Tec9 Weapon");
        return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp(cmdtext, "/gunshop", true) == 0)
        {
        ShowMenuForPlayer(weaponmenu, playerid);
        return 1;
        }
        return 0;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
        new Menu:CurrentMenu = GetPlayerMenu(playerid);
        if(CurrentMenu == weaponmenu)
        {
        switch(row)
        {
                case 0: //9mm
                {
                    new name[24];
                    GetPlayerName(name,sizeof name);
                    new reason[128];
                    format(reason,sizeof(reason),"Player %s has nightvision goggles (Check before ban!!)",name);
                    SendClientMessageToAdmins(LIGHT_BLUE, reason, 1);
                    GivePlayerMoney(playerid, -500);
                    GivePlayerWeapon(playerid, 22 , 500);
                    SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your 9mm!");
                }
                case 1: //Silenced 9mm
                {
                    GivePlayerMoney(playerid, -500);
                    GivePlayerWeapon(playerid, 23 , 500);
                    SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Silenced 9mm!");
                }
                case 2: //Desert Eagle
                {
                    GivePlayerMoney(playerid, -500);
                    GivePlayerWeapon(playerid, 24 , 500);
                    SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Desert Eagle!");
                }
                case 3: //Shotgun
                {
                    GivePlayerMoney(playerid, -700);
                    GivePlayerWeapon(playerid, 25 , 500);
                    SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Shotgun!!");
                }
                case 4: //Sawnoff Shotgun
                {
                    GivePlayerMoney(playerid, -1000);
                    GivePlayerWeapon(playerid, 26 , 500);
                    SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Sawnoff Shotgun!");
                }
                case 5: //Combat Shotgun
                {
                    GivePlayerMoney(playerid, -700);
                    GivePlayerWeapon(playerid, 27 , 500);
                    SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Combat Shotgun!");
                }
                case 6: //Micro SMG (Uzi)
                {
                    GivePlayerMoney(playerid, -800);
                    GivePlayerWeapon(playerid, 28 , 500);
                    SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Micro SMG (Uzi)!");
                }
                case 7: //M4
                {
                    GivePlayerMoney(playerid, -1200);
                    GivePlayerWeapon(playerid, 31 , 500);
                    SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your M4!");
                }
                case 8: //Tec9
                {
                    GivePlayerMoney(playerid, -1000);
                    GivePlayerWeapon(playerid, 32 , 500);
                    SendClientMessage(playerid, LIGHT_BLUE, "Enjoy your Tec9!");

                }
               
        }
        }
        return 1;
}
stock SendClientMessageToAdmins(color, text[])
{
    for(new a, g = GetMaxPlayers(); a < g; a++)
        if(IsPlayerConnected(a) && IsPlayerAdmin(a))
            SendClientMessage(a, color, text);
}
pawn Код:
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(45) : error 035: argument type mismatch (argument 1)
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(45) : error 035: argument type mismatch (argument 2)
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(48) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

Which lines are the error ones?
Reply
#3

Line 45:
PHP код:
GetPlayerName(name,sizeof name); 
should be
PHP код:
GetPlayerName(playerid,name,24); 
.
Line 48:
PHP код:
SendClientMessageToAdmins(LIGHT_BLUEreason1); 
You have 3 arguments. And here:
PHP код:
stock SendClientMessageToAdmins(colortext[]) 
You have 2 arguments. Fix that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)