Compile Errors -
SecretBoss - 31.01.2015
I have this
pawn Код:
stock ReturnTime(timevariable)
{
new milliseconds = timevariable, seconds, minutes, string[20];
while(milliseconds > 9)
{
seconds ++;
milliseconds = milliseconds - 10;
}
while(seconds > 59)
{
minutes ++;
seconds = seconds - 60;
}
format(string, sizeof(string), "%d:%02d.%03d", minutes, seconds, milliseconds);
}
return string;
}
And I take the following compile errors
pawn Код:
(3371) : warning 209: function "ReturnTime" should return a value
(3372) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
If anything is missing tell me and I will provide it to you
Re: Compile Errors -
ATGOggy - 31.01.2015
Which are the lines?
Re: Compile Errors -
SecretBoss - 31.01.2015
What do you mean?
Re: Compile Errors -
M4D - 31.01.2015
i suggest you use this simple function:
pawn Код:
stock Sec2HMS(secs, &hours, &minutes, &seconds)
{
if (secs < 0) return false;
minutes = secs / 60;
seconds = secs % 60;
hours = minutes / 60;
minutes = minutes % 60;
return 1;
}
an example:
pawn Код:
new sec = 5162;
new Hours, Minutes, Seconds;
Sec2HMS(sec, Hours, Minutes, Seconds);
printf("%d:%d:%d",Hours, Minutes, Seconds);
//Output: 1:26:2
Re: Compile Errors -
SecretBoss - 31.01.2015
I took this tutorial and I edited it
https://sampforum.blast.hk/showthread.php?tid=401252
Re: Compile Errors -
ATGOggy - 31.01.2015
Quote:
Originally Posted by ATGOggy
Which are the lines?
|
Show the lines of error.
Re: Compile Errors -
SecretBoss - 31.01.2015
Leave it I am going to make another race system
btw can you help me with another thing?
I have this
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID ) { //check if the player is connected and it's a VALID KILL
if(GetPlayerWantedLevel(killerid) < 6) //if the player's wantedlevel is under 6
{
SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1); //increase it by 1
}
Streaks[killerid] ++; //the sign '++' means, increase the variable for the killerid by 1
GivePlayerMoney(killerid, 1500); //if you like, give the killer some money, else comment this line out
}
SetPlayerWantedLevel(playerid, 0); //the player who died will get his wanted level reset to 0
Streaks[playerid] = 0; //and his streak will end, while giving the value '0' to this variable
SetPlayerScore(killerid,GetPlayerScore(killerid)+2); //not really necessary, would increase the player's score by 1 point
GameTextForPlayer(playerid,"~g~ +2 Score",3000,1);
new str[ 256 ], KillerName[MAX_PLAYER_NAME]; //here, you're defining a string and the killername
GetPlayerName(killerid, KillerName, sizeof(KillerName)); //receive the information of the killer's name
switch(Streaks[killerid]) //IMPORTANT: with the function "switch", you're switching / toggling through the killstreaks of a player (Streals). you need the killerid here, because the playerid is the one which is GETTING killed
{
case 3:
{
format(str, sizeof(str), ""white"["red"KS"white"] "green"%s "grey"is on a kill streak with 3 kills", KillerName);
SendClientMessageToAll(-1, str);
GameTextForPlayer(playerid,"REWARD ~n~ ~g~ +3 additional score",3000,6);
SetPlayerScore(killerid,GetPlayerScore(killerid)+3);
}
case 5:
{
format(str, sizeof(str), ""white"["red"KS"white"] "green"%s "white"is on a kill streak with 5 kills", KillerName);
SendClientMessageToAll(-1, str);
GameTextForPlayer(playerid,"REWARD ~n~ ~g~ +5 additional score",3000,6);
SetPlayerScore(killerid,GetPlayerScore(killerid)+5);
}
case 10:
{
format(str, sizeof(str), ""white"["red"KS"white"] "green"%s "white"is on a kill streak with 10 kills", KillerName);
SendClientMessageToAll(-1, str);
GameTextForPlayer(playerid,"REWARD ~n~ ~g~ +7 additional score",3000,6);
SetPlayerScore(killerid,GetPlayerScore(killerid)+7);
}
case 15:
{
format(str, sizeof(str), ""white"["red"KS"white"] "green"%s "white"is on a kill streak with 15 kills", KillerName);
SendClientMessageToAll(-1, str);
GameTextForPlayer(playerid,"REWARD ~n~ ~g~ +10 additional score",3000,6);
SetPlayerScore(killerid,GetPlayerScore(killerid)+10);
}
case 30:
{
format(str, sizeof(str), ""white"["red"KS"white"] "green"%s "white"is on a kill streak with 30 kills", KillerName);
SendClientMessageToAll(-1, str);
GameTextForPlayer(playerid,"REWARD ~n~ ~g~ +15 additional score",3000,6);
SetPlayerScore(killerid,GetPlayerScore(killerid)+15);
}
case 50:
{
format(str, sizeof(str), ""white"["red"KS"white"] "green"%s "white"is on a kill streak with 50 kills", KillerName);
SendClientMessageToAll(-1, str);
GameTextForPlayer(playerid,"REWARD ~n~ ~g~ +20 additional score",3000,6);
SetPlayerScore(killerid,GetPlayerScore(killerid)+20);
}
}
return 1;
}
This is something like killstreak system but when a player kill me it says that I got +2 score but in fact I didn't how to fix it?
Re: Compile Errors -
ATGOggy - 31.01.2015
Change all:
PHP код:
GameTextForPlayer(playerid,"......);
To:
PHP код:
GameTextForPlayer(killerid,"......);
Re: Compile Errors -
SecretBoss - 31.01.2015
Thanks and something other, how I can remove 500$ from the player who got killed?
Re: Compile Errors -
ATGOggy - 31.01.2015
Remove this line:
PHP код:
GivePlayerMoney(killerid, 1500);