12 errors urgent
#1

C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(12 -- 14) : error 029: invalid expression, assumed zero
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(12 -- 16) : error 001: expected token: ")", but found "public"
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(19) : error 010: invalid function or declaration
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(22 -- 23) : error 029: invalid expression, assumed zero
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(22 -- 23) : warning 215: expression has no effect
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(24) : error 010: invalid function or declaration
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(27 -- 2 : error 017: undefined symbol "playerid"
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(27 -- 2 : error 001: expected token: ")", but found ";"
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(29) : error 001: expected token: ";", but found "return"
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(31) : error 010: invalid function or declaration
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(31) : error 001: expected token: "-identifier-", but found "-string-"
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(31) : error 010: invalid function or declaration
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(31) : fatal error 107: too many error messages on one line

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


12 Errors.
Reply
#2

Show the code.
Reply
#3

//my first gamemode

#include <a_samp>
#include <streamer>
#include <sscanf2>
#include <YSI\y_commands>

#define COLOR_RED 0xFF0000FF


main()
(

)

public Ongamemodeinit()
(
return 1;
)

public OnGameModeExit()
(
return 1;
)

public OnPlayerConnect()
(
SendClientMessage (playerid, COLOR_RED, "WELCOME TO THE AVIATION LIFE");
return 1;");
//message to all players
SendClientMessafeToALL (COLOR_RED<"A Player Has Joined the server");
return 1;
)

public OnPlayerDisconnect()
(
return 1;
)
Reply
#4

Use braces, not paranthesises.
And also, "return 1;");", what's that supposed to be?
Return stops the code, so it wont even reach the second SendClientMessageToAll.
Where you again misspelled it, it should me Message, not Messafe, and then "COLOR_RED<", should be "COLOR_RED,".
Then you also misspelled OnGameModeInit, remember that PAWN is case sensitive.
And lastly, OnPlayerConnect/Disconnect has a playerid parameter. "OnPlayerConnect(playerid)".
Reply
#5

can u write the correct code i dont understand bro
Reply
#6

\Users\Dell\Desktop\server\gamemodes\Untitled.pwn( 12 -- 14) : error 029: invalid expression, assumed zero
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(12 -- 16) : error 001: expected token: ")", but found "public"
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(19) : error 010: invalid function or declaration
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(22 -- 23) : error 029: invalid expression, assumed zero
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(22 -- 23) : warning 215: expression has no effect
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(24) : error 010: invalid function or declaration
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(27 -- 2 : error 017: undefined symbol "playerid"
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(27 -- 2 : error 001: expected token: ")", but found ";"
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(29) : error 001: expected token: ";", but found "return"
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(31) : error 010: invalid function or declaration
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(32) : error 010: invalid function or declaration
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(36 -- 37) : error 029: invalid expression, assumed zero
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(36 -- 37) : warning 215: expression has no effect
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(3 : error 010: invalid function or declaration
C:\Users\Dell\Desktop\server\gamemodes\Untitled.pw n(40) : warning 203: symbol is never used: "Ongamemodeinit"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


12 Errors.
Reply
#7

Код:
#include <a_samp>
#include <streamer>
#include <sscanf2>
#include <YSI\y_commands>

#define COLOR_RED 0xFF0000FF


main()
{

}

public Ongamemodeinit()
{
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerConnect()
{
    SendClientMessage (playerid, COLOR_RED, "WELCOME TO THE AVIATION LIFE");
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
public OnPlayerDisconnect()
{
return 1;
}
Replace your code with this code.
Reply
#8

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Use braces, not paranthesises.
And also, "return 1;");", what's that supposed to be?
Return stops the code, so it wont even reach the second SendClientMessageToAll.
Where you again misspelled it, it should me Message, not Messafe, and then "COLOR_RED<", should be "COLOR_RED,".
Then you also misspelled OnGameModeInit, remember that PAWN is case sensitive.
And lastly, OnPlayerConnect/Disconnect has a playerid parameter. "OnPlayerConnect(playerid)".
Read this carefully, this explains why you encountred errors.


pawn Код:
#include <a_samp>
#include <streamer>
#include <sscanf2>
#include <YSI\y_commands>

#define COLOR_RED 0xFF0000FF


main()
{
       return 1;
}

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, COLOR_RED, "WELCOME TO THE AVIATION LIFE");
    //message to all players
    SendClientMessageToAll (COLOR_RED, "A Player Has Joined the server");
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    return 1;
}
Reply
#9

Quote:
Originally Posted by iFiras
Посмотреть сообщение
Read this carefully, this explains why you encountred errors.
The main-function should also have braces, not parenthesises.
Reply
#10

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
The main-function should also have braces, not parenthesises.
Yes, I didn't pay attention, thank you.
Modified my post.
Reply
#11

+ rep can u guys rep back
Reply
#12

Quote:
Originally Posted by hardiksingh5
View Post
+ rep can u guys rep back
Why should they rep you? You're the one asking for help, they're the ones providing...


We don't rep people just because they asked for help, that's not what it's for.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)