#1

Guys i want to change this cmd strcmp to zcmd

PHP код:
SendClientMessage(playeridCOLOR_GRAD2"USAGE: (/ad)vertise [advert text]"); 
                return 
1
            } 
            if ((!
adds) && (PlayerInfo[playerid][pAdmin] < 1)) 
            { 
                
format(stringsizeof(string), "   Please try again later %d seconds between Advertisements !",  (addtimer/1000)); 
                
SendClientMessage(playeridCOLOR_GRAD2string); 
                return 
1
            } 
            new 
payout idx 25
            if(
GetPlayerMoney(playerid) < payout
            { 
                
format(stringsizeof(string), "* You used %d characters which cost $%d, you don't have enough."offsetpayout); 
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring); 
                return 
1
            } 
            
GivePlayerMoney(playerid, - payout); 
            
format(stringsizeof(string), "Advertisement: %s, Contact: %s Ph: %d",  resultsendername,PlayerInfo[playerid][pPnumber]); 
            
OOCNews(COLOR_GREEN,string); 
            
format(stringsizeof(string), "~r~Paid $%d~n~~w~Message contained: %d Characters"payoutidx); 
            
GameTextForPlayer(playeridstring50005); 
            if (
PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn"addtimer0);adds 0;} 
        } 
        return 
1
    } 
i made this but i have a lot of errors and idk how to solve it cuz im new in this lenguage...

PHP код:
CMD:advertise(playeridparams[])
{
    new 
string[128], name[MAX_PLAYER_NAME+1];
    if(
sscanf(params"s[128]"params)) return SendClientMessage(playeridCOLOR_CORRECTION"USAGE: (/ad)vertise [Advert Text]");
    if(
PlayerInfo[playerid][pAdmin] < 1)
    {
        if(
PlayerInfo[playerid][pLevel] <= 1) return SendClientMessage(playeridCOLOR_CORRECTION"You must be level 2 to place an advertise!");
        if(
ServerAdvert gettime())
        {
            
format(stringsizeof(string), "You must wait %d to put another ad"ServerAdvert gettime());
            return 
SendClientMessage(playerid, -1string);
        }
        else
        {
            
GetPlayerName(playeridnamesizeof(name));
            
ServerAdvert gettime()+120;// 120 seconds
            
format(stringsizeof(string), "Advertisement: %s Contact: %s Ph: %d"paramsnamePlayerInfo[playerid][Phone]);
            
SendClientMessageToAll(COLOR_ADVERTISEstring);
            
GivePlayerMoney(playerid, -1000);
        }
    }
    else
    {
       
GetPlayerName(playeridnamesizeof(name));
       
ServerAdvert gettime()+120;// 120 seconds
       
format(stringsizeof(string), "Advertisement: %s Contact: %s Ph: %d"paramsnamePlayerInfo[playerid][Phone]);
       
SendClientMessageToAll(COLOR_ADVERTISEstring);
       
GivePlayerMoney(playerid, -1000);
    }
    return 
1;

can you help me pls

errors:

Код:
C:\Users\Jaua\Downloads\Nuevo\pawno\include\YSI\..\YSI_Storage\..\YSI_Core\y_utils.inc(430) : warning 201: redefinition of constant/macro (symbol "isnull(%1)")
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(181) : warning 217: loose indentation
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(182) : warning 217: loose indentation
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(183) : warning 217: loose indentation
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(184) : warning 217: loose indentation
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(244) : warning 217: loose indentation
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(245) : warning 217: loose indentation
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(604) : error 017: undefined symbol "pLevel"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(605) : error 017: undefined symbol "ServerAdvert"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(607) : error 017: undefined symbol "ServerAdvert"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(613) : error 017: undefined symbol "ServerAdvert"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(613) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(614) : error 017: undefined symbol "Phone"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(622) : error 017: undefined symbol "ServerAdvert"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(622) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(623) : error 017: undefined symbol "Phone"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(629) : warning 203: symbol is never used: "FactSkins0"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(629) : warning 203: symbol is never used: "FactSkins1"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(629) : warning 203: symbol is never used: "FactSkins2"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(629) : warning 203: symbol is never used: "FactSkins3"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(629) : warning 203: symbol is never used: "FactSkins4"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(629) : warning 203: symbol is never used: "FactSkins5"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(629) : warning 203: symbol is never used: "FactSkins6"
C:\Users\Jaua\Downloads\Nuevo\gamemodes\RP.pwn(629) : warning 203: symbol is never used: "FactSkins7"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Reply
#2

to fix the loose indentation

and from FactSkins1 - 7 which is unused symbol just disable it, you have to put " // to disable those unused symbol bruv.
i hope it helped
PHP код:
CMD:advertise(playeridparams[]) 

    new 
string[128], name[MAX_PLAYER_NAME+1]; 
    if(
sscanf(params"s[128]"params)) return SendClientMessage(playeridCOLOR_CORRECTION"USAGE: (/ad)vertise [Advert Text]"); 
    if(
PlayerInfo[playerid][pAdmin] < 1
    { 
        if(
PlayerInfo[playerid][pLevel] <= 1) return SendClientMessage(playeridCOLOR_CORRECTION"You must be level 2 to place an advertise!"); 
        if(
ServerAdvert gettime()) 
        { 
            
format(stringsizeof(string), "You must wait %d to put another ad"ServerAdvert gettime()); 
            return 
SendClientMessage(playerid, -1string); 
        } 
        else 
        { 
            
GetPlayerName(playeridnamesizeof(name)); 
            
ServerAdvert gettime()+120;// 120 seconds 
            
format(stringsizeof(string), "Advertisement: %s Contact: %s Ph: %d"paramsnamePlayerInfo[playerid
            [
Phone]); 
            
SendClientMessageToAll(COLOR_ADVERTISEstring); 
            
GivePlayerMoney(playerid, -1000); 
        } 
    } 
    else 
    { 
            
GetPlayerName(playeridnamesizeof(name)); 
            
ServerAdvert gettime()+120;// 120 seconds 
            
format(stringsizeof(string), "Advertisement: %s Contact: %s Ph: %d"paramsnamePlayerInfo[playerid
            [
Phone]); 
            
SendClientMessageToAll(COLOR_ADVERTISEstring); 
            
GivePlayerMoney(playerid, -1000); 
    } 
    return 
1

Reply
#3

Try this
PHP код:
#define ADV_TIME 120000
CMD:advertise(playeridparams[]) 

    new 
string[128], name[MAX_PLAYER_NAME+1]; 
    if(
sscanf(params"s[128]"params)) return SendClientMessage(playeridCOLOR_CORRECTION"USAGE: (/ad)vertise [Advert Text]"); 
    if(
PlayerInfo[playerid][pAdmin] < 1) return 0;
    if(
GetPlayerScore <= 1) return SendClientMessage(playeridCOLOR_CORRECTION"You must be level 2 to place an advertise!"); 
    { 
            
GetPlayerName(playeridnamesizeof(name)); 
            
format(stringsizeof(string), "Advertisement: %s Contact: %s Ph: %d"paramsnamePlayerInfo[playerid][Phone]); 
            
SendClientMessageToAll(COLOR_ADVERTISEstring); 
            
GivePlayerMoney(playerid, -1000); 
            
SetTimerEx("AdvertiseWait"ADV_TIME,1"i"playerid); 
    } 
    return 
1
}  
forward AdvertiseWait(playerid);
public 
AdvertiseWait(playerid)
{
 new 
string[100];
 
format(stringsizeof(string), "Please wait %d seconds for next advertise"ADV_TIME);
 
SendClientMessage(playeridCOLOR_CORRECTIONstring);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)