Jump to content
  • 0

Problema cu pawno [erori]


smokeyutzu

Question

Sal am o problema imi da niste erori

Acelea sunt:

[pawn]D:\MyDocuments\Downloads\[www.fisierulmeu.ro] samp03csvr_win32\samp03csvr_win32\filterscripts\Clock.pwn(48) : warning 235: public function lacks forward declaration (symbol "OnPlayerComandText")

D:\MyDocuments\Downloads\[www.fisierulmeu.ro] samp03csvr_win32\samp03csvr_win32\filterscripts\Clock.pwn(51) : error 001: expected token: ";", but found "-identifier-"

D:\MyDocuments\Downloads\[www.fisierulmeu.ro] samp03csvr_win32\samp03csvr_win32\filterscripts\Clock.pwn(51) : error 017: undefined symbol "strtok"

D:\MyDocuments\Downloads\[www.fisierulmeu.ro] samp03csvr_win32\samp03csvr_win32\filterscripts\Clock.pwn(51) : error 033: array must be indexed (variable "cmd")

D:\MyDocuments\Downloads\[www.fisierulmeu.ro] samp03csvr_win32\samp03csvr_win32\filterscripts\Clock.pwn(51) : fatal error 107: too many error messages on one line

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

4 Errors.

[/pawn]

Si asta e fs-u creat de mn in care am erorile

[pawn]//============Ceas romania by Smokey==============

//===========FileScript=========

#include <a_samp>

#include <zcmd>

#include <time>

#define FILTERSCRIPT

new Text:Time, Text:Date;

new realtime;

forward settime(playerid);

public OnFilterScriptInit()

{

print("\n--------------------------------------");

print("Clock FileScript Loaded");

print("--------------------------------------\n");

    SetTimer("settime",1000,true);

Date = TextDrawCreate(547.000000,11.000000,"--");

TextDrawFont(Date,3);

TextDrawLetterSize(Date,0.399999,1.600000);

    TextDrawColor(Date,0xffffffff);

Time = TextDrawCreate(547.000000,28.000000,"--");

TextDrawFont(Time,3);

TextDrawLetterSize(Time,0.399999,1.600000);

TextDrawColor(Time,0xffffffff);

SetTimer("settime",1000,true);

return 1;

}

public OnFilterScriptExit()

{

print("\n-----------------------------------------------------");

print("Ceas romania FileScript Loaded");

print("-----------------------------------------------------/n");

return 1;

}

public OnPlayerComandText(playerid, cmdtext[])

{

new cmd[256]

cmd =strtok (cmdtext, idx);

//----------------------------------[TIME]-----------------------------------------------

   

if(strcmp(cmd, "/timp", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

    new mtext[20];

new year, month,day;

getdate(year, month, day);

if(month == 1) { mtext = "Ianuarie"; }

else if(month == 2) { mtext = "Februarie"; }

else if(month == 3) { mtext = "Martie"; }

else if(month == 4) { mtext = "Aprilie"; }

else if(month == 5) { mtext = "May"; }

else if(month == 6) { mtext = "Yunie"; }

else if(month == 7) { mtext = "Yulie"; }

else if(month == 8) { mtext = "August"; }

else if(month == 9) { mtext = "Septembrie"; }

else if(month == 10) { mtext = "Octombrie"; }

else if(month == 11) { mtext = "Noiembrie"; }

else if(month == 12) { mtext = "Decembrie"; }

    new hour,minuite,second;

gettime(hour,minuite,second);

FixHour(hour);

hour = shifthour;

if (minuite < 10)

{

if (PlayerInfo[playerid][pJailTime] > 0)

{

format(string, sizeof(string), "~r~%d %s|~y~%d:0%d~b~|~r~Jail ~y~Time ~b~Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);

}

else

{

format(string, sizeof(string), "~r~%d %s|~y~%d:~b~0%d|", day, mtext, hour, minuite);

}

}

else

{

if (PlayerInfo[playerid][pJailTime] > 0)

{

format(string, sizeof(string), "~r~%d %s|~y~%d:~b~%d|~r~Jail ~y~Time ~b~Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);

}

else

{

format(string, sizeof(string), "~r~%d %s|~y~%d:~b~%d|", day, mtext, hour, minuite);

}

}

GameTextForPlayer(playerid, string, 5000, 1);

}

return 1;

}

}

public OnPlayerSpawn(playerid)

{

TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);

return 1;

}

public OnPlayerDisconnect(playerid, reason)

{

TextDrawHideForPlayer(playerid, Time), TextDrawHideForPlayer(playerid, Date);

return 1;

}

public settime(playerid)

{

new string[256],year,month,day,hours,minutes,seconds;

getdate(year, month, day), gettime(hours, minutes, seconds);

format(string, sizeof string, "~r~%d/~y~%s%d/~b~%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);

TextDrawSetString(Date, string);

format(string, sizeof string, "~r~%s%d:~y~%s%d:~b~%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);

TextDrawSetString(Time, string);

}[/pawn]

Va rog sa ma ajutati

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

Pune la sfarsitul gm-ului asta:

strtok(const string[], &index) { 	new length = strlen(string); 	while ((index < length) && (string[index] <= ' ')) 	{ 		index++; 	}   	new offset = index; 	new result[20]; 	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) 	{ 		result[index - offset] = string[index]; 		index++; 	} 	result[index - offset] = EOS; 	return result; }

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Link to comment
Share on other sites

Adaug? asta la sfâr?it-ul scriptului.

[pawn]strtok(const string[], &index)

{

    new length = strlen(string);

    while ((index < length) && (string[index] <= ' '))

    {

        index++;

    }

    new offset = index;

    new result[20];

    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

    {

        result[index - offset] = string[index];

        index++;

    }

    result[index - offset] = EOS;

    return result;

}[/pawn]

Link to comment
Share on other sites

[pawn]//============Ceas romania by Smokey==============

//===========FileScript=========

#include <a_samp>

#include <time>

#define FILTERSCRIPT

enum pInfo {

pJailTime

};

new PlayerInfo[MAX_PLAYERS][pInfo];

new Text:Time, Text:Date;

new shifthour;

new timeshift = 0;

forward settime(playerid);

public OnFilterScriptInit()

{

print("\n--------------------------------------");

print("Clock FileScript Loaded");

print("--------------------------------------\n");

Date = TextDrawCreate(547.000000,11.000000,"--");

TextDrawFont(Date,3);

TextDrawLetterSize(Date,0.399999,1.600000);

    TextDrawColor(Date,0xffffffff);

Time = TextDrawCreate(547.000000,28.000000,"--");

TextDrawFont(Time,3);

TextDrawLetterSize(Time,0.399999,1.600000);

TextDrawColor(Time,0xffffffff);

SetTimer("settime",1000,true);

return 1;

}

public OnFilterScriptExit()

{

print("\n-----------------------------------------------------");

print("Ceas romania FileScript Loaded");

print("-----------------------------------------------------/n");

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

new cmd[256], idx;

cmd = strtok (cmdtext, idx);

//----------------------------------[TIME]-----------------------------------------------

if(strcmp(cmd, "/timp", true) == 0)

{

    if(IsPlayerConnected(playerid))

{

    new mtext[20];

new year, month,day;

new string[800];

getdate(year, month, day);

if(month == 1) { mtext = "Ianuarie"; }

else if(month == 2) { mtext = "Februarie"; }

else if(month == 3) { mtext = "Martie"; }

else if(month == 4) { mtext = "Aprilie"; }

else if(month == 5) { mtext = "May"; }

else if(month == 6) { mtext = "Yunie"; }

else if(month == 7) { mtext = "Yulie"; }

else if(month == 8) { mtext = "August"; }

else if(month == 9) { mtext = "Septembrie"; }

else if(month == 10) { mtext = "Octombrie"; }

else if(month == 11) { mtext = "Noiembrie"; }

else if(month == 12) { mtext = "Decembrie"; }

    new hour,minuite,second;

gettime(hour,minuite,second);

FixHour(hour);

hour = shifthour;

if (minuite < 10)

{

if (PlayerInfo[playerid][pJailTime] > 0)

{

format(string, sizeof(string), "~r~%d %s|~y~%d:0%d~b~|~r~Jail ~y~Time ~b~Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);

}

else

{

format(string, sizeof(string), "~r~%d %s|~y~%d:~b~0%d|", day, mtext, hour, minuite);

}

}

else

{

if (PlayerInfo[playerid][pJailTime] > 0)

{

format(string, sizeof(string), "~r~%d %s|~y~%d:~b~%d|~r~Jail ~y~Time ~b~Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);

}

else

{

format(string, sizeof(string), "~r~%d %s|~y~%d:~b~%d|", day, mtext, hour, minuite);

}

}

GameTextForPlayer(playerid, string, 5000, 1);

}

return 1;

}

return 0;

}

public OnPlayerSpawn(playerid)

{

TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);

return 1;

}

public OnPlayerDisconnect(playerid, reason)

{

TextDrawHideForPlayer(playerid, Time), TextDrawHideForPlayer(playerid, Date);

return 1;

}

public settime(playerid)

{

new string[256],year,month,day,hours,minutes,seconds;

getdate(year, month, day), gettime(hours, minutes, seconds);

format(string, sizeof string, "~r~%d/~y~%s%d/~b~%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);

TextDrawSetString(Date, string);

format(string, sizeof string, "~r~%s%d:~y~%s%d:~b~%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);

TextDrawSetString(Time, string);

}

strtok(const string[], &index)

{

    new length = strlen(string);

    while ((index < length) && (string[index] <= ' '))

    {

        index++;

    }

    new offset = index;

    new result[20];

    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

    {

        result[index - offset] = string[index];

        index++;

    }

    result[index - offset] = EOS;

    return result;

}

forward FixHour(hour);

public FixHour(hour) {

hour = timeshift+hour;

if (hour < 0) {

hour = hour+24; }

else if (hour > 23) {

hour = hour-24; }

shifthour = hour;

return (1) ; }[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.