SA-MP Forums Archive
public KillStreak - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: public KillStreak (/showthread.php?tid=201146)



public KillStreak - Face9000 - 20.12.2010

I'm making this:

Код:
public KillStreak(playerid)
(
   if((GetPlayerScore(playerid) >= 15)
    {
    SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 15 score! 2000$ for you!");
    GivePlayerMoney(playerid, 2000);
   )
   if((GetPlayerScore(playerid) >= 30)
    {
    SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 30 score! 4000$ for you!");
    GivePlayerMoney(playerid, 4000);
    return 1;
)
I've already added:

forward KillStreak(playerid);

But i got this:

Код:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2316 -- 2317) : error 029: invalid expression, assumed zero
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2322) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2326) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.



Re: public KillStreak - Seven. - 20.12.2010

pawn Код:
public KillStreak(playerid)
{
   if((GetPlayerScore(playerid) >= 15)
    {
    SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 15 score! 2000$ for you!");
    GivePlayerMoney(playeridid, 2000);
   }
   if((GetPlayerScore(playerid) >= 30)
    {
    SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 30 score! 4000$ for you!");
    GivePlayerMoney(playeridid, 4000);
   }
 return 1;
}



Re: public KillStreak - Face9000 - 20.12.2010

Код:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2318) : error 028: invalid subscript (not an array or too many subscripts): "GetPlayerScore"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2322) : error 010: invalid function or declaration
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2327) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.



Re: public KillStreak - Leeroy. - 20.12.2010

pawn Код:
public KillStreak(playerid)
{
   if(GetPlayerScore(playerid) >= 15)
   {
       SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 15 score! 2000$ for you!");
       GivePlayerMoney(playeridid, 2000);
   }
   if(GetPlayerScore(playerid) >= 30)
   {
       SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 30 score! 4000$ for you!");
        GivePlayerMoney(playeridid, 4000);
   }
 return 1;
}



Re: public KillStreak - Freddi-25 - 20.12.2010

pawn Код:
public KillStreak(playerid)
{
    if(GetPlayerScore(playerid) >= 15)
    {
        SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 15 score! 2000$ for you!");
        GivePlayerMoney(playerid, 2000);
    }
    if(GetPlayerScore(playerid) >= 30)
    {
        SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 30 score! 4000$ for you!");
        GivePlayerMoney(playerid, 4000);
    }
    return 1;
}
I'm pretty sure this will work.


Re: public KillStreak - Leeroy. - 20.12.2010

Quote:
Originally Posted by Freddi-25
Посмотреть сообщение
pawn Код:
public KillStreak(playerid)
{
    if(GetPlayerScore(playerid) >= 15)
    {
        SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 15 score! 2000$ for you!");
        GivePlayerMoney(playerid, 2000);
    }
    if(GetPlayerScore(playerid) >= 30)
    {
        SendClientMessage(playerid,COLOR_YELLOW,"You have now reached 30 score! 4000$ for you!");
        GivePlayerMoney(playerid, 4000);
    }
    return 1;
}
I'm pretty sure this will work.
Copy paste much ?

I edited Stevens code if you can read.


Re: public KillStreak - The_Gangstas - 20.12.2010

if(GetPlayerScore(playerid) >= 15) this will spam

if(GetPlayerScore(playerid) >= 15 && PlayerInfo[playerid][pKillstreak][0] == 0)

say the timer is set to 3 seconds and u kill 2 ppl in 2 seconds, there health was 1-10 or something, you wont unlock it. you must make a var with it unless the timer is fast


Re: public KillStreak - Freddi-25 - 20.12.2010

Quote:
Originally Posted by leeroy1337
Посмотреть сообщение
Copy paste much ?

I edited Stevens code if you can read.
Find the errors in your code.


Re: public KillStreak - Face9000 - 20.12.2010

Ok.Thanks all.


Re: public KillStreak - Jochemd - 20.12.2010

If there's something I hate, it are the double ((... Only use it on the calculate-rules.. :/