Problem.. [help]
#1

Код:
CMD:giveweapontoy(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337)
    {
        new string[128], giveplayerid, object, slot;
        if(sscanf(params, "udd", giveplayerid, object, slot)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /giveweapontoy [playerid] [number] [slot]");
            SendClientMessageEx(playerid, COLOR_WHITE, "339 Katana 346 9mm 347 SDPistol");
            SendClientMessageEx(playerid, COLOR_WHITE, "348 Deagle 349 Shotgun 351 Spas");
            SendClientMessageEx(playerid, COLOR_WHITE, "352 Micro Uzi 353 MP5 355 AK");
            SendClientMessageEx(playerid, COLOR_WHITE, "356 M4 358 Sniper");

        if(slot < 0 || slot > 5) return SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid slot, must be between 0 and 5");
        if( (object > 335 && object < 335) || (object > 339 && object < 339) || (object > 346 && object < 346) ||
        (object > 347 && object < 347) || (object > 348 && object < 348) || (object > 349 && object < 349) || (object > 351 && object < 351) || (object && 352 || object && 352) || (object > 353 && object < 353)  || (object > 356 && object < 356) || object == 358 || object == 358)
	    {
            if (IsPlayerConnected(giveplayerid))
            {
                PlayerToyInfo[giveplayerid][slot][ptModelID] = object;
                PlayerToyInfo[giveplayerid][slot][ptBone] = 1;
                format(string, sizeof(string), "You have given %s weapon toy %d in slot %d", GetPlayerNameEx(giveplayerid), object, slot);
                SendClientMessageEx(playerid, COLOR_YELLOW, string);
                SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have received a new /toys from an administrator!");
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid object");
        }
    }
    return 1;
}
When i write /giveweapontoy its only shows this:

Код:
USAGE: /giveweapontoy [playerid] [number] [slot]
But not this:

Код:
USAGE: /giveweapontoy [playerid] [number] [slot]
339 Katana 346 9mm 347 SDPistol
348 Deagle 349 Shotgun 351 Spas
352 Micro Uzi 353 MP5 355 AK
356 M4 358 Sniper
Reply
#2

Help?
Reply
#3

Someone?
Reply
#4

Someone?
Reply
#5

Код:
CMD:giveweapontoy(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337)
    {
        new string[128], giveplayerid, object, slot;
        if(sscanf(params, "udd", giveplayerid, object, slot)) 
        SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /giveweapontoy [playerid] [number] [slot]");
        SendClientMessageEx(playerid, COLOR_WHITE, "339 Katana 346 9mm 347 SDPistol");
        SendClientMessageEx(playerid, COLOR_WHITE, "348 Deagle 349 Shotgun 351 Spas");
        SendClientMessageEx(playerid, COLOR_WHITE, "352 Micro Uzi 353 MP5 355 AK");
        SendClientMessageEx(playerid, COLOR_WHITE, "356 M4 358 Sniper");

        if(slot < 0 || slot > 5) return SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid slot, must be between 0 and 5");
        if( (object > 335 && object < 335) || (object > 339 && object < 339) || (object > 346 && object < 346) ||
        (object > 347 && object < 347) || (object > 348 && object < 348) || (object > 349 && object < 349) || (object > 351 && object < 351) || (object && 352 || object && 352) || (object > 353 && object < 353)  || (object > 356 && object < 356) || object == 358 || object == 358)
	    {
            if (IsPlayerConnected(giveplayerid))
            {
                PlayerToyInfo[giveplayerid][slot][ptModelID] = object;
                PlayerToyInfo[giveplayerid][slot][ptBone] = 1;
                format(string, sizeof(string), "You have given %s weapon toy %d in slot %d", GetPlayerNameEx(giveplayerid), object, slot);
                SendClientMessageEx(playerid, COLOR_YELLOW, string);
                SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have received a new /toys from an administrator!");
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid object");
        }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Thour57
Посмотреть сообщение
Код:
CMD:giveweapontoy(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337)
    {
        new string[128], giveplayerid, object, slot;
        if(sscanf(params, "udd", giveplayerid, object, slot)) 
        SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /giveweapontoy [playerid] [number] [slot]");
        SendClientMessageEx(playerid, COLOR_WHITE, "339 Katana 346 9mm 347 SDPistol");
        SendClientMessageEx(playerid, COLOR_WHITE, "348 Deagle 349 Shotgun 351 Spas");
        SendClientMessageEx(playerid, COLOR_WHITE, "352 Micro Uzi 353 MP5 355 AK");
        SendClientMessageEx(playerid, COLOR_WHITE, "356 M4 358 Sniper");

        if(slot < 0 || slot > 5) return SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid slot, must be between 0 and 5");
        if( (object > 335 && object < 335) || (object > 339 && object < 339) || (object > 346 && object < 346) ||
        (object > 347 && object < 347) || (object > 348 && object < 348) || (object > 349 && object < 349) || (object > 351 && object < 351) || (object && 352 || object && 352) || (object > 353 && object < 353)  || (object > 356 && object < 356) || object == 358 || object == 358)
	    {
            if (IsPlayerConnected(giveplayerid))
            {
                PlayerToyInfo[giveplayerid][slot][ptModelID] = object;
                PlayerToyInfo[giveplayerid][slot][ptBone] = 1;
                format(string, sizeof(string), "You have given %s weapon toy %d in slot %d", GetPlayerNameEx(giveplayerid), object, slot);
                SendClientMessageEx(playerid, COLOR_YELLOW, string);
                SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have received a new /toys from an administrator!");
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid object");
        }
    }
    return 1;
}
That won't work.
Try this:
pawn Код:
CMD:giveweapontoy(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1337)
    {
        new string[128], giveplayerid, object, slot;
        if(sscanf(params, "udd", giveplayerid, object, slot))
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /giveweapontoy [playerid] [number] [slot]");
            SendClientMessageEx(playerid, COLOR_WHITE, "339 Katana 346 9mm 347 SDPistol");
            SendClientMessageEx(playerid, COLOR_WHITE, "348 Deagle 349 Shotgun 351 Spas");
            SendClientMessageEx(playerid, COLOR_WHITE, "352 Micro Uzi 353 MP5 355 AK");
            SendClientMessageEx(playerid, COLOR_WHITE, "356 M4 358 Sniper");
            return 1;
        }
        if(slot < 0 || slot > 5) return SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid slot, must be between 0 and 5");
        if( (object > 335 && object < 335) || (object > 339 && object < 339) || (object > 346 && object < 346) ||
        (object > 347 && object < 347) || (object > 348 && object < 348) || (object > 349 && object < 349) || (object > 351 && object < 351) || (object && 352 || object && 352) || (object > 353 && object < 353)  || (object > 356 && object < 356) || object == 358 || object == 358)
        {
            if (IsPlayerConnected(giveplayerid))
            {
                PlayerToyInfo[giveplayerid][slot][ptModelID] = object;
                PlayerToyInfo[giveplayerid][slot][ptBone] = 1;
                format(string, sizeof(string), "You have given %s weapon toy %d in slot %d", GetPlayerNameEx(giveplayerid), object, slot);
                SendClientMessageEx(playerid, COLOR_YELLOW, string);
                SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have received a new /toys from an administrator!");
            }
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid object");
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)