SA-MP Forums Archive
GivePlayerWeapon... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GivePlayerWeapon... (/showthread.php?tid=300930)



GivePlayerWeapon... - Gooday - 02.12.2011

HI....

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/chief186", true) == 0) {
        // Set the player's skin to ID 277, which is a fireman.
        SetPlayerSkin(playerid, 275);
        GivePlayerWeapon(playerid, COLOR_GOLD, 42, 10000);
        SendClientMessage(playerid, COLOR_GOLD,"[INFO]You logged in as BCFD Chief.");
        return 1;
    }
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/chief186", true) == 0) {
        // Set the player's skin to ID 277, which is a fireman.
        SetPlayerSkin(playerid, 275);
        GivePlayerWeapon(playerid, COLOR_GOLD, 42, 10000);
        SendClientMessage(playerid, COLOR_GOLD,"[INFO]You logged in as BCFD Chief.");
        return 1;
    }
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/chief186", true) == 0) {
        // Set the player's skin to ID 277, which is a fireman.
        SetPlayerSkin(playerid, 275);
        GivePlayerWeapon(playerid, COLOR_GOLD, 42, 10000);
        SendClientMessage(playerid, COLOR_GOLD,"[INFO]You logged in as BCFD Chief.");
        return 1;
    }
got this warn...
Quote:

C:\Documents and Settings\Luca\Desktop\BaseScript\filterscripts\ski ns.pwn(8 : warning 202: number of arguments does not match definition
C:\Documents and Settings\Luca\Desktop\BaseScript\filterscripts\ski ns.pwn(95) : warning 202: number of arguments does not match definition

please help!


Re: GivePlayerWeapon... - Kaperstone - 02.12.2011

all are the same 0.0
anyway can you show as line 88 and 95.


Respuesta: GivePlayerWeapon... - iKeN - 02.12.2011

GivePlayerWeapon(playerid, COLOR_GOLD, 42, 10000);
pawn Код:
GivePlayerWeapon(playerid, weaponid, ammo);



Re: GivePlayerWeapon... - AstonDA-G - 02.12.2011

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/chief186", true) == 0) {
        // Set the player's skin to ID 277, which is a fireman.
        SetPlayerSkin(playerid, 275);
        GivePlayerWeapon(playerid, 42, 10000);
        SendClientMessage(playerid, COLOR_GOLD,"[INFO]You logged in as BCFD Chief.");
        return 1;
    }
    return 0;
}



Re: Respuesta: GivePlayerWeapon... - Kaperstone - 02.12.2011

Quote:
Originally Posted by iKeN
Посмотреть сообщение
GivePlayerWeapon(playerid, COLOR_GOLD, 42, 10000);
pawn Код:
GivePlayerWeapon(playerid, weaponid, ammo);
lol?
anyway,the 2nd error/warning:
You have typed:
pawn Код:
if(strcmp(cmdtext, "/chief186", true) == 0) {
it should be:
pawn Код:
if (strcmp("/chief186", cmdtext, true, 10) == 0)



Respuesta: GivePlayerWeapon... - iKeN - 02.12.2011

Quote:
Originally Posted by xkirill
Посмотреть сообщение
lol?
anyway,the 2nd error/warning:
You have typed:
pawn Код:
if(strcmp(cmdtext, "/chief186", true) == 0) {
it should be:
pawn Код:
if (strcmp("/chief186", cmdtext, true, 10) == 0)
that error is talking about?
Код:
C:\Documents and Settings\Luca\Desktop\BaseScript\filterscripts\ski ns.pwn(8 ) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Luca\Desktop\BaseScript\filterscripts\ski ns.pwn(95) : warning 202: number of arguments does not match definition
only says that exceeded the parameters of the function.
and the order I think it gives the same.
pawn Код:
if(strcmp(cmdtext, "/chief186", true) == 0)
https://sampwiki.blast.hk/wiki/Strcmp


Re: GivePlayerWeapon... - GrInDzO - 06.04.2012

Just like iKeN says: GivePlayerWeapon(playerid, COLOR_GOLD, 42, 10000);

Paste, like this: GivePlayerWeapon(playerid, 42, 10000);