WTF help fast please, weird errors !
#1

Hello, gamemode was working fine for an second ago, then i added /Website command, and these errors came up

Код:
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(117) : warning 217: loose indentation
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(117) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(117) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(122) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(122) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(122) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(127) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(127) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(127) : error 004: function "OnPlayerStateChange" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(132) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(132) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(132) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(137) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(137) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(137) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(142) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(142) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(142) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(147) : warning 225: unreachable code
What is wrong !?!? I removed the command and compiled after that ! but still error, then i closed without saving and STILL that errors! please help me .. fast : s
Reply
#2

Looks like you forgot a { or } somewhere. Check the part you worked on last.
Reply
#3

It has something with this to do

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/help", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, red, "~~~Help~~~ ");
        SendClientMessage(playerid, red, "First Of All Read The Rules! ");
        SendClientMessage(playerid, red, "Do So By Typing /Rules In The Chat Window ");
        SendClientMessage(playerid, red, "/Teles To See All Of The Teleports. ");
        SendClientMessage(playerid, red, "/Carmenu To Open The Vehicle Menu. ");
        SendClientMessage(playerid, red, "/Anims To See More About Animations. ");
        SendClientMessage(playerid, red, "/Website If You Would Like To Visit Our Forums. ");
        SendClientMessage(playerid, red, "If You Would Like To Talk More Private ");
        SendClientMessage(playerid, red, "You Can PM Your Friends With /PM Followed By Their ID or Nickname. ");
        return 1;
    }

    if (strcmp("/rules", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, red, " ~~Rules~~");
        SendClientMessage(playerid, red, "Never beg to be an admin! If you would like to be an admin sign up at forums");
        SendClientMessage(playerid, red, "Never steal other peoples cars! (Not their wifes either hihi !)");
        SendClientMessage(playerid, red, "NEVER deathmatch outside of deathmatch ares, it WILL lead to an kick/bann");
        SendClientMessage(playerid, red, "And remember, be nice to people and they will be nice to you! ");
        return 1;
    }
I copyed this part

Код:
if (strcmp("/rules", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, red, " ~~Rules~~");
And made it
Код:
 if (strcmp("/website", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, red, "www.stuntrevolutionserver.tk");
And placed it under rules as rules is under help.. thats when the error occured, dosent help to remove it and make it as it was tho.. : s
Reply
#4

Oh and ofcourse with the
Код:
return 1; 
)
under to..
Reply
#5

(please edit your post instead of double posting)

is it really
return 1;
)

or
return 1;
}

?

if it ends with a ), change it to a }, this would be the source of your errors.
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/help", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, red, "~~~Help~~~ ");
        SendClientMessage(playerid, red, "First Of All Read The Rules! ");
        SendClientMessage(playerid, red, "Do So By Typing /Rules In The Chat Window ");
        SendClientMessage(playerid, red, "/Teles To See All Of The Teleports. ");
        SendClientMessage(playerid, red, "/Carmenu To Open The Vehicle Menu. ");
        SendClientMessage(playerid, red, "/Anims To See More About Animations. ");
        SendClientMessage(playerid, red, "/Website If You Would Like To Visit Our Forums. ");
        SendClientMessage(playerid, red, "If You Would Like To Talk More Private ");
        SendClientMessage(playerid, red, "You Can PM Your Friends With /PM Followed By Their ID or Nickname. ");
        return 1;
    }

    if (strcmp("/rules", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, red, " ~~Rules~~");
        SendClientMessage(playerid, red, "Never beg to be an admin! If you would like to be an admin sign up at forums");
        SendClientMessage(playerid, red, "Never steal other peoples cars! (Not their wifes either hihi !)");
        SendClientMessage(playerid, red, "NEVER deathmatch outside of deathmatch ares, it WILL lead to an kick/bann");
        SendClientMessage(playerid, red, "And remember, be nice to people and they will be nice to you! ");
        return 1;
    }
You forgot to close the callback 'OnPlayerCommandText', well, that's what you post here.
And why are you counting the length of the command?
1. /help doesn't have 10 'symbols'
2. /rules doesn't have 10 'symbols'.
You only count the length if you plan to use CMDtext.
Like /pm, etc.
3. You used the wrong 'strcmp'.
You're not using CMDtext so it should be:
if(strcmp(cmd, "/help", true) == 0)
and
if(strcmp(cmd, "/rules", true) == 0)
So, use this code:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd, "/help", true) == 0)
    {
        SendClientMessage(playerid, red, "~~~Help~~~ ");
        SendClientMessage(playerid, red, "First Of All Read The Rules! ");
        SendClientMessage(playerid, red, "Do So By Typing /Rules In The Chat Window ");
        SendClientMessage(playerid, red, "/Teles To See All Of The Teleports. ");
        SendClientMessage(playerid, red, "/Carmenu To Open The Vehicle Menu. ");
        SendClientMessage(playerid, red, "/Anims To See More About Animations. ");
        SendClientMessage(playerid, red, "/Website If You Would Like To Visit Our Forums. ");
        SendClientMessage(playerid, red, "If You Would Like To Talk More Private ");
        SendClientMessage(playerid, red, "You Can PM Your Friends With /PM Followed By Their ID or Nickname. ");
        return 1;
    }

    if(strcmp(cmd, "/rules", true) == 0)
    {
        SendClientMessage(playerid, red, " ~~Rules~~");
        SendClientMessage(playerid, red, "Never beg to be an admin! If you would like to be an admin sign up at forums");
        SendClientMessage(playerid, red, "Never steal other peoples cars! (Not their wifes either hihi !)");
        SendClientMessage(playerid, red, "NEVER deathmatch outside of deathmatch ares, it WILL lead to an kick/bann");
        SendClientMessage(playerid, red, "And remember, be nice to people and they will be nice to you! ");
        return 1;
    }
}
Good luck.
Reply
#7

Thank you !

but now i get these errors instead.. >.<

Код:
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(8) : warning 201: redefinition of constant/macro (symbol "red")
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(101) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(115) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(124) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#8

Quote:
Originally Posted by Kitten_Blind
Посмотреть сообщение
Thank you !

but now i get these errors instead.. >.<

Код:
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(8) : warning 201: redefinition of constant/macro (symbol "red")
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(101) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(115) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(124) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
gamemode top: #define red 0xFF0000FF

Edit sript:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd, "/help", true) == 0)
    {
        SendClientMessage(playerid, red, "~~~Help~~~ ");
        SendClientMessage(playerid, red, "First Of All Read The Rules! ");
        SendClientMessage(playerid, red, "Do So By Typing /Rules In The Chat Window ");
        SendClientMessage(playerid, red, "/Teles To See All Of The Teleports. ");
        SendClientMessage(playerid, red, "/Carmenu To Open The Vehicle Menu. ");
        SendClientMessage(playerid, red, "/Anims To See More About Animations. ");
        SendClientMessage(playerid, red, "/Website If You Would Like To Visit Our Forums. ");
        SendClientMessage(playerid, red, "If You Would Like To Talk More Private ");
        SendClientMessage(playerid, red, "You Can PM Your Friends With /PM Followed By Their ID or Nickname. ");
        return 1;
    }

    if(strcmp(cmd, "/rules", true) == 0)
    {
        SendClientMessage(playerid, red, " ~~Rules~~");
        SendClientMessage(playerid, red, "Never beg to be an admin! If you would like to be an admin sign up at forums");
        SendClientMessage(playerid, red, "Never steal other peoples cars! (Not their wifes either hihi !)");
        SendClientMessage(playerid, red, "NEVER deathmatch outside of deathmatch ares, it WILL lead to an kick/bann");
        SendClientMessage(playerid, red, "And remember, be nice to people and they will be nice to you! ");
        return 1;
    }
    return 0;
}
Reply
#9

And:

Below
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
add this:
pawn Код:
new cmd[128];
cmd = strtok(cmdtext, idx);
Reply
#10

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
And:

Below
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
add this:
pawn Код:
new cmd[128];
cmd = strtok(cmdtext, idx);
not very good idea

if(strcmp(cmd, "/help", true) == 0)
{

change to

if(strcmp(cmdtext, "/help", true) == 0)
{
Reply
#11

Ok done that now i get this warning
Код:
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(9) : warning 201: redefinition of constant/macro (symbol "red")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/help", true) == 0)
	{
        SendClientMessage(playerid, clp, "~~~Help~~~ ");
        SendClientMessage(playerid, clp, "First Of All Read The Rules! ");
        SendClientMessage(playerid, clp, "Do So By Typing /Rules In The Chat Window ");
        SendClientMessage(playerid, clp, "/Teles To See All Of The Teleports. ");
        SendClientMessage(playerid, clp, "/Carmenu To Open The Vehicle Menu. ");
        SendClientMessage(playerid, clp, "/Anims To See More About Animations. ");
        SendClientMessage(playerid, clp, "/Website If You Would Like To Visit Our Forums. ");
        SendClientMessage(playerid, clp, "If You Would Like To Talk More Private ");
        SendClientMessage(playerid, clp, "You Can PM Your Friends With /PM Followed By Their ID or Nickname. ");
        return 1;
    }

    if(strcmp(cmdtext, "/help", true) == 0)
	{
        SendClientMessage(playerid, clp, " ~~Rules~~");
        SendClientMessage(playerid, clp, "Never beg to be an admin! If you would like to be an admin sign up at forums");
        SendClientMessage(playerid, clp, "Never steal other peoples cars! (Not their wifes either hihi !)");
        SendClientMessage(playerid, clp, "NEVER deathmatch outside of deathmatch ares, it WILL lead to an kick/bann");
        SendClientMessage(playerid, clp, "And remember, be nice to people and they will be nice to you! ");
        return 1;
    }
    return 0;
}
Look ive done all you said.. (btw, my "red" wasent same red as one of you gave me color name from so i saved the color i had as clp"

Код:
#define clp 0xFF00FFAA
Reply
#12

you have definided mutiple times the macro 'red' you should have it only one time defined.
Reply
#13

Yeah i figured that out, so i compiled without errors, but then when i added a /website command these errors came up.. -.-

Код:
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(126 -- 127) : error 017: undefined symbol "SencClientMessage"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(126 -- 127) : error 001: expected token: ")", but found ";"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(128) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(129) : warning 225: unreachable code
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(129) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(129 -- 131) : warning 215: expression has no effect
C:\Documents and Settings\Administratцr\Skrivbord\SAMP server\gamemodes\Stuntrevolution.pwn(131) : error 001: expected token: ";", but found "return"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Look ive done exactly as above on the other 2 commands.... >.<
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/help", true) == 0)
	{
        SendClientMessage(playerid, clp, "~~~Help~~~ ");
        SendClientMessage(playerid, clp, "First Of All Read The Rules! ");
        SendClientMessage(playerid, clp, "Do So By Typing /Rules In The Chat Window ");
        SendClientMessage(playerid, clp, "/Teles To See All Of The Teleports. ");
        SendClientMessage(playerid, clp, "/Carmenu To Open The Vehicle Menu. ");
        SendClientMessage(playerid, clp, "/Anims To See More About Animations. ");
        SendClientMessage(playerid, clp, "/Website If You Would Like To Visit Our Forums. ");
        SendClientMessage(playerid, clp, "If You Would Like To Talk More Private ");
        SendClientMessage(playerid, clp, "You Can PM Your Friends With /PM Followed By Their ID or Nickname. ");
        return 1;
    }

    if(strcmp(cmdtext, "/help", true) == 0)
	{
        SendClientMessage(playerid, clp, " ~~Rules~~");
        SendClientMessage(playerid, clp, "Never beg to be an admin! If you would like to be an admin sign up at forums");
        SendClientMessage(playerid, clp, "Never steal other peoples cars! (Not their wifes either hihi !)");
        SendClientMessage(playerid, clp, "NEVER deathmatch outside of deathmatch ares, it WILL lead to an kick/bann");
        SendClientMessage(playerid, clp, "And remember, be nice to people and they will be nice to you! ");
        return 1;
    }
    
    if (strcmp(cmdtext, "/website", true) == 0)
 	(
		SencClientMessage(playerid, green, "www.StuntRevolutionServer.tk");
		return 1;
	)
	
    return 0;
}
Reply
#14

dude its SendClientMessage not 'SencClientMessage' lol,
seems like you are doing your job too fast, just chill out take it slowly, most of the erros
you show are coming from tipe mistakes...
Reply
#15

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/help", true) == 0)
    {
        SendClientMessage(playerid, clp, "~~~Help~~~ ");
        SendClientMessage(playerid, clp, "First Of All Read The Rules! ");
        SendClientMessage(playerid, clp, "Do So By Typing /Rules In The Chat Window ");
        SendClientMessage(playerid, clp, "/Teles To See All Of The Teleports. ");
        SendClientMessage(playerid, clp, "/Carmenu To Open The Vehicle Menu. ");
        SendClientMessage(playerid, clp, "/Anims To See More About Animations. ");
        SendClientMessage(playerid, clp, "/Website If You Would Like To Visit Our Forums. ");
        SendClientMessage(playerid, clp, "If You Would Like To Talk More Private ");
        SendClientMessage(playerid, clp, "You Can PM Your Friends With /PM Followed By Their ID or Nickname. ");
        return 1;
    }

    if(strcmp(cmdtext, "/help", true) == 0)
    {
        SendClientMessage(playerid, clp, " ~~Rules~~");
        SendClientMessage(playerid, clp, "Never beg to be an admin! If you would like to be an admin sign up at forums");
        SendClientMessage(playerid, clp, "Never steal other peoples cars! (Not their wifes either hihi !)");
        SendClientMessage(playerid, clp, "NEVER deathmatch outside of deathmatch ares, it WILL lead to an kick/bann");
        SendClientMessage(playerid, clp, "And remember, be nice to people and they will be nice to you! ");
        return 1;
    }

    if (strcmp(cmdtext, "/website", true) == 0)
    {
        SendClientMessage(playerid, green, "www.StuntRevolutionServer.tk");
        return 1;
    }

    return 0;
}
This should work.
Reply
#16

Quote:
Originally Posted by Freddi-25
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/help", true) == 0)
    {
        SendClientMessage(playerid, clp, "~~~Help~~~ ");
        SendClientMessage(playerid, clp, "First Of All Read The Rules! ");
        SendClientMessage(playerid, clp, "Do So By Typing /Rules In The Chat Window ");
        SendClientMessage(playerid, clp, "/Teles To See All Of The Teleports. ");
        SendClientMessage(playerid, clp, "/Carmenu To Open The Vehicle Menu. ");
        SendClientMessage(playerid, clp, "/Anims To See More About Animations. ");
        SendClientMessage(playerid, clp, "/Website If You Would Like To Visit Our Forums. ");
        SendClientMessage(playerid, clp, "If You Would Like To Talk More Private ");
        SendClientMessage(playerid, clp, "You Can PM Your Friends With /PM Followed By Their ID or Nickname. ");
        return 1;
    }

    if(strcmp(cmdtext, "/help", true) == 0)
    {
        SendClientMessage(playerid, clp, " ~~Rules~~");
        SendClientMessage(playerid, clp, "Never beg to be an admin! If you would like to be an admin sign up at forums");
        SendClientMessage(playerid, clp, "Never steal other peoples cars! (Not their wifes either hihi !)");
        SendClientMessage(playerid, clp, "NEVER deathmatch outside of deathmatch ares, it WILL lead to an kick/bann");
        SendClientMessage(playerid, clp, "And remember, be nice to people and they will be nice to you! ");
        return 1;
    }

    if (strcmp(cmdtext, "/website", true) == 0)
    {
        SendClientMessage(playerid, green, "www.StuntRevolutionServer.tk");
        return 1;
    }

    return 0;
}
This should work.
Yes,this needs to work,i checked it letter by letter
But idk if you defined the "green" or "clp"
Reply
#17

Thank you all! Yes i got around 10 colours defined, but seems like everytime im making a new command there is some error o.o even if i delete it after ! thats weird, but thanks to you all!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)