23.07.2017, 15:54
Hi all
I am Changing my old commands to zcmd
so i have ended up with having errors:
My code is this
I am Changing my old commands to zcmd
so i have ended up with having errors:
PHP код:
C:\Users\Farha\Desktop\New Server\CNRSF\pawno\include\cnr/lotto.inc(81) : error 017: undefined symbol "strtok"
C:\Users\Farha\Desktop\New Server\CNRSF\pawno\include\cnr/lotto.inc(81) : error 033: array must be indexed (variable "cmds")
C:\Users\Farha\Desktop\New Server\CNRSF\pawno\include\cnr/lotto.inc(83) : error 017: undefined symbol "strtok"
C:\Users\Farha\Desktop\New Server\CNRSF\pawno\include\cnr/lotto.inc(83) : error 033: array must be indexed (variable "dir")
C:\Users\Farha\Desktop\New Server\CNRSF\pawno\include\cnr/lotto.inc(80) : warning 203: symbol is never used: "idxs"
PHP код:
CMD:lotto(playerid, params[])
{
new cmds[256];
new idxs;
cmds = strtok(cmdtext, idxs);
new dir[256];
dir = strtok(cmdtext, idxs);
if (!strlen(dir))
{
SendClientMessage(playerid, COLOR_RED, "SYNTAX: /lotto [number]");
return 1;
}
new number = strval(dir);
if (LottoParticipant[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "You already have a lotto ticket.");
}
else
{
if (GetPlayerMoney(playerid) >= LOTTO_PRICE)
{
if (number > 0 && number < 100)
{
if (NumberUsed[number] == 0)
{
new strings[256];
format(strings, sizeof(strings), "You have purchased the lotto number %d and you have been charged $5000 for the ticket.", number);
SendClientMessage(playerid,COLOR_YELLOW,strings);
SendClientMessage(playerid,COLOR_YELLOW,"Draw will commence at 06:00 and 18:00.");
PlayerLottoGuess[playerid] = number;
LottoParticipant[playerid] = 1;
takeMoney(playerid,5000);
}
else
{
SendClientMessage(playerid, COLOR_RED, "The number you selected is already choosed by another player.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "The number you entered is invalid, please type a number between 0 and 98.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You do not have enought money to buy a lotto ticket.");
}
}
return 1;
}