/pks cmd problem
#1

PHP код:
CMD:pks(playeridparams[])
{
 new 
moneys1string[128];
 for (new 
0PLAYERSi++)
 {
      if (
IsPlayerConnected2(i))
      {
               if (
pklvl[playerid] > 0)
               {
                
moneys1++;
               }
               else if(
pklvl[playerid] == 2)
               {
                   if(
pklvl[playerid] > 0)
                   {
                       
moneys1++;
                   }
               }
      }
 }
 if (
moneys1 != 0)
 {
      
SendClientMessage(playeridCOLOR_GREEN"===========| Online Peace Keepers |===========");
      new 
p=6;
      while (
0)
      {
          for (new 
0PLAYERSi++)
          {
               if (
pklvl[i] == p)
            {
                  
format(string128"{FFFFFF}%s - %s{FFFFFF} "RPN(i), pkLVL(p),p);
                  
SendClientMessage(playeridCOLOR_WHITEstring);
            }
            else if(
pklvl[i] == p)
            {
                if(
pklvl[playerid] == 1)
                {
                  
format(string128"{FFFFFF}%s - %s{FFFFFF}"RPN(i), pkLVL(p),p);
                  
SendClientMessage(playeridCOLOR_WHITEstring);
                }
            }
          }
          
p--;
      }
 }
 else 
SendClientMessage(playeridCOLOR_RED"There are currently no Peace Keepers online.");
 return 
1;

Getting Error Undefined Symbol "pkLVL"
Reply
#2

Seems like your variable is pklvl, change pkLVL to pklvl >.>
Reply
#3

When i did pklvl, Its giving me error.

PHP код:
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan's\gamemodes\pG.pwn(40802) : error 012: invalid function call, not a valid address
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan'
s\gamemodes\pG.pwn(40802) : warning 215expression has no effect
E
:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan's\gamemodes\pG.pwn(40802) : error 001: expected token: ";", but found ")"
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan'
s\gamemodes\pG.pwn(40802) : error 029invalid expressionassumed zero
E
:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan's\gamemodes\pG.pwn(40802) : fatal error 107: too many error messages on one line 
Reply
#4

Can you show the line 40802 ? There's a lil problem
Reply
#5

PHP код:
format(string128"{FFFFFF}%s - %s{FFFFFF} "RPN(i), pklvl(p),p); 
Reply
#6

Show the variable of pklvl In your script
Reply
#7

Quote:
Originally Posted by Wherethescripters
Посмотреть сообщение
When i did pklvl, Its giving me error.

PHP код:
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan's\gamemodes\pG.pwn(40802) : error 012: invalid function call, not a valid address
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan'
s\gamemodes\pG.pwn(40802) : warning 215expression has no effect
E
:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan's\gamemodes\pG.pwn(40802) : error 001: expected token: ";", but found ")"
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan'
s\gamemodes\pG.pwn(40802) : error 029invalid expressionassumed zero
E
:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan's\gamemodes\pG.pwn(40802) : fatal error 107: too many error messages on one line 
That can't be caused by simply changing the sensitivity of a word. You're doing something wrong.

Quote:
Originally Posted by Wherethescripters
Посмотреть сообщение
PHP код:
format(string128"{FFFFFF}%s - %s{FFFFFF} "RPN(i), pklvl(p),p); 
Here, right. You're escaping twice in your strings but there are 3 variables mentioned?
Reply
#8

no there are only 2
Reply
#9

PHP код:
CMD:pks(playerid,params[])
{
    
SendClientMessage(playeridCOLOR_ORANGE"Current Peace Keepers Online..");
    new 
count=0;
    new 
string[256], pname[MAX_PLAYER_NAME];
    foreach(
Playeri){
    if (
IsPlayerConnected(i)){
    if (
pklvl[i] == 1){
     
GetPlayerName(i,pname,sizeof(pname));
     
format(string128"%s - ({FFCC00}Peace Keeper{FFFFFF})"pname);
     
SendClientMessage(playeridCOLOR_WHITEstring);
     
count++;}
    }
    }
    if(
count==0)
    
SendClientMessage(playeridCOLOR_WHITE,"There are currently no pk members online.");
    return 
1;

See when i put this code it gives me error

PHP код:
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan's\pawno\include\FCNPC.inc(498) : error 001: expected token: "-identifier-", but found "("
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan'
s\pawno\include\FCNPC.inc(539) : error 017undefined symbol "Iter_Clear"
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan's\pawno\include\FCNPC.inc(539) : warning 215: expression has no effect
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan'
s\pawno\include\FCNPC.inc(539) : error 001expected token";"but found ")"
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan's\pawno\include\FCNPC.inc(539) : error 029: invalid expression, assumed zero
E:\SAMP-SCRIPTS\GTA San Andreas\Latest scripts\pG\pG For Testing (Latest)\pG Clan'
s\pawno\include\FCNPC.inc(539) : fatal error 107too many error messages on one line
Compilation aborted
.
Pawn compiler 3.2.3664              Copyright (c1997-2017ITB CompuPhase
5 Errors

Even it doesn't Contain Iter_Clear and when i removed this code my script compile successfully but i want /pks cmd to see online pks.
Reply
#10

Ok man here you go your problem fix.....

First of all #defines these:

Код:
#define PK_LEVEL_1_COLOR 0xFF0000FF  // or any color you want
#define PK_LEVEL_1 "Peace Keeper"
Then write this anywhere in your script:
Код:
stock PKLVL(lvl)
{
	new string[128];
	switch(lvl)
	{
		case 1:
		{
			format(string, 128, "%s %s", PK_LEVEL_1_COLOR, PK_LEVEL_1);
		}
	}
	return string;
}
put this anywhere in your script (instead of don't put in any commands )

And then in your command CMD: pks, re-write every pkLVL to PKLVL

And you're done! Tell me if it don't works
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)