#1

Hey guys i made this cmd but it send me this error / warnings

Код:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\LIMPIO.pwn(507) : error 012: invalid function call, not a valid address
C:\Users\Jaua\Downloads\gta-rp\gamemodes\LIMPIO.pwn(507) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\gta-rp\gamemodes\LIMPIO.pwn(507) : error 001: expected token: ";", but found ")"
C:\Users\Jaua\Downloads\gta-rp\gamemodes\LIMPIO.pwn(507) : error 029: invalid expression, assumed zero
C:\Users\Jaua\Downloads\gta-rp\gamemodes\LIMPIO.pwn(507) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
i think i define my line correctly here line 507:

PHP код:
format(stringsizeof(string), "Advertisement: %s Contact: %s Ph: %d"paramsname(playerid), PlayerInfo[playerid][Phone]); 
full code:

PHP код:
CMD:advertise(playeridparams[])
{
    new 
string[128], name[64] ;
     
GetPlayerName(playeridnamesizeof(name));
    if(
PlayerInfo[playerid][pLevel] < 1) return SendClientMessage(playeridCOLOR_CORRECTION"You must be level 2 to place an advertise!");
    if(
sscanf(params"s[128]"params)) return SendClientMessage(playeridCOLOR_CORRECTION"USAGE: (/ad)vertise [Advert Text]");
    if(
ServerAdvert == 1)
    {
        
SendClientMessage(playeridCOLOR_CORRECTION"Only one advertisement can be published every 120 seconds!");
    }
    else
    {
        
ServerAdvert 1;
        
format(stringsizeof(string), "Advertisement: %s Contact: %s Ph: %d"paramsname(playerid), PlayerInfo[playerid][Phone]);
        
SendClientMessageToAll(COLOR_ADVERTISEstring);
        
SetTimer("AdTimer"120000false);
        
GivePlayerMoney(playerid, -1000);
    }
    return 
1;
}
CMD:ad(playeridparams[])
{
  return 
cmd_advertise(playeridparams);
}
public 
AdTimer()
{
    
ServerAdvert 0;
    return 
1;

Reply
#2

On the top I think you're having :

PHP код:
enum aInfo 

    
pAdmin 

new 
PlayerInfo[MAX_PLAYERS][aInfo]; 
So ? Did you see the issue ?
Reply
#3

Change name(playerid) to name
Reply
#4

Here is the solution:
PHP код:
format(stringsizeof(string), "Advertisement: %s Contact: %s Ph: %d"paramsnamePlayerInfo[playerid][Phone]); 
You just had to remove the (playerid) of the name, because you already defined the playerid, when you got the player's name!
Edited: Here you are definding the player's ID: GetPlayerName(playerid, name, sizeof(name));
Reply
#5

Oh i see, and what about this?

Код:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\LIMPIO.pwn(522) : warning 235: public function lacks forward declaration (symbol "AdTimer")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#6

Quote:
Originally Posted by Jaua10
Посмотреть сообщение
Oh i see, and what about this?

Код:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\LIMPIO.pwn(522) : warning 235: public function lacks forward declaration (symbol "AdTimer")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
You need to declare the function:

Above public AdTimer()

add this:

Код:
function public AdTimer();
Reply
#7

You have to add it:
PHP код:
forward AdTimer();
public 
AdTimer() 

    
ServerAdvert 0
    return 
1

Reply
#8

Alright guys it works, another question men, how can i make to if im admin i want send infinite /ad cmd without waiting the time or level of restriction of the /ad cmd??
Reply
#9

Quote:
Originally Posted by Jaua10
Посмотреть сообщение
Oh i see, and what about this?

Код:
C:\Users\Jaua\Downloads\gta-rp\gamemodes\LIMPIO.pwn(522) : warning 235: public function lacks forward declaration (symbol "AdTimer")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Quote:
Originally Posted by Jaua10
Посмотреть сообщение
Alright guys it works, another question men, how can i make to if im admin i want send infinite /ad cmd without waiting the time or level of restriction of the /ad cmd??
Take out the SetTimer("AdTimer", 120000, false);
Reply
#10

is already solved, worse I mean, is that as I would do to add it to that command, some kind of exception where if I am an administrator I can make use of the command /ad at the time I want and with the level that I want without any limitation because I am the admin.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)