/ad -
Jaua10 - 16.04.2018
Guys i want to change this cmd strcmp to zcmd
PHP код:
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/ad)vertise [advert text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), " Please try again later %d seconds between Advertisements !", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
new payout = idx * 25;
if(GetPlayerMoney(playerid) < payout)
{
format(string, sizeof(string), "* You used %d characters which cost $%d, you don't have enough.", offset, payout);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
GivePlayerMoney(playerid, - payout);
format(string, sizeof(string), "Advertisement: %s, Contact: %s Ph: %d", result, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(COLOR_GREEN,string);
format(string, sizeof(string), "~r~Paid $%d~n~~w~Message contained: %d Characters", payout, idx);
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);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(playerid, params[])
{
new string[128], name[MAX_PLAYER_NAME+1];
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: (/ad)vertise [Advert Text]");
if(PlayerInfo[playerid][pAdmin] < 1)
{
if(PlayerInfo[playerid][pLevel] <= 1) return SendClientMessage(playerid, COLOR_CORRECTION, "You must be level 2 to place an advertise!");
if(ServerAdvert > gettime())
{
format(string, sizeof(string), "You must wait %d to put another ad", ServerAdvert - gettime());
return SendClientMessage(playerid, -1, string);
}
else
{
GetPlayerName(playerid, name, sizeof(name));
ServerAdvert = gettime()+120;// 120 seconds
format(string, sizeof(string), "Advertisement: %s Contact: %s Ph: %d", params, name, PlayerInfo[playerid][Phone]);
SendClientMessageToAll(COLOR_ADVERTISE, string);
GivePlayerMoney(playerid, -1000);
}
}
else
{
GetPlayerName(playerid, name, sizeof(name));
ServerAdvert = gettime()+120;// 120 seconds
format(string, sizeof(string), "Advertisement: %s Contact: %s Ph: %d", params, name, PlayerInfo[playerid][Phone]);
SendClientMessageToAll(COLOR_ADVERTISE, string);
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.
Re: /ad -
TitoRayne - 16.04.2018
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(playerid, params[])
{
new string[128], name[MAX_PLAYER_NAME+1];
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: (/ad)vertise [Advert Text]");
if(PlayerInfo[playerid][pAdmin] < 1)
{
if(PlayerInfo[playerid][pLevel] <= 1) return SendClientMessage(playerid, COLOR_CORRECTION, "You must be level 2 to place an advertise!");
if(ServerAdvert > gettime())
{
format(string, sizeof(string), "You must wait %d to put another ad", ServerAdvert - gettime());
return SendClientMessage(playerid, -1, string);
}
else
{
GetPlayerName(playerid, name, sizeof(name));
ServerAdvert = gettime()+120;// 120 seconds
format(string, sizeof(string), "Advertisement: %s Contact: %s Ph: %d", params, name, PlayerInfo[playerid]
[Phone]);
SendClientMessageToAll(COLOR_ADVERTISE, string);
GivePlayerMoney(playerid, -1000);
}
}
else
{
GetPlayerName(playerid, name, sizeof(name));
ServerAdvert = gettime()+120;// 120 seconds
format(string, sizeof(string), "Advertisement: %s Contact: %s Ph: %d", params, name, PlayerInfo[playerid]
[Phone]);
SendClientMessageToAll(COLOR_ADVERTISE, string);
GivePlayerMoney(playerid, -1000);
}
return 1;
}
Re: /ad -
ProScripter - 16.04.2018
Try this
PHP код:
#define ADV_TIME 120000
CMD:advertise(playerid, params[])
{
new string[128], name[MAX_PLAYER_NAME+1];
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: (/ad)vertise [Advert Text]");
if(PlayerInfo[playerid][pAdmin] < 1) return 0;
if(GetPlayerScore <= 1) return SendClientMessage(playerid, COLOR_CORRECTION, "You must be level 2 to place an advertise!");
{
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Advertisement: %s Contact: %s Ph: %d", params, name, PlayerInfo[playerid][Phone]);
SendClientMessageToAll(COLOR_ADVERTISE, string);
GivePlayerMoney(playerid, -1000);
SetTimerEx("AdvertiseWait", ADV_TIME,1, "i", playerid);
}
return 1;
}
forward AdvertiseWait(playerid);
public AdvertiseWait(playerid)
{
new string[100];
format(string, sizeof(string), "Please wait %d seconds for next advertise", ADV_TIME);
SendClientMessage(playerid, COLOR_CORRECTION, string);
}