SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/10/2019, 01:16 PM   #1
PhantomBird
Little Clucker
 
Join Date: Aug 2017
Posts: 8
Reputation: 0
Default Please help why can't I compile gamemode?

https://0paste.com/39933 -- GAMEMODE


ERRORS:

C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(3653) : error 017: undefined symbol "IsValidVehicle"
C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4484) : error 001: expected token: ";", but found "-string-"
C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4484) : warning 215: expression has no effect
C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4484) : error 001: expected token: ";", but found ")"
C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4484) : error 029: invalid expression, assumed zero
C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4484) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.


Please fix this for me! Willing to pay anyone that does!
PhantomBird is offline   Reply With Quote
Old 15/10/2019, 01:46 PM   #2
Boarden
Little Clucker
 
Boarden's Avatar
 
Join Date: Jun 2014
Location: (Formerly Great) Britain
Posts: 32
Reputation: 4
Default Re: Please help why can't I compile gamemode?

Try adding

Code:
native IsValidVehicle(vehicleid);
to your gamemode.
Boarden is offline   Reply With Quote
Old 15/10/2019, 01:48 PM   #3
PhantomBird
Little Clucker
 
Join Date: Aug 2017
Posts: 8
Reputation: 0
Default Re: Please help why can't I compile gamemode?

I have zero PWN experience. I'm not sure what this means. I added it under line 29 and got 4 errors this time. Remaining ones are:

C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4485) : error 001: expected token: ";", but found "-string-"
C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4485) : warning 215: expression has no effect
C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4485) : error 001: expected token: ";", but found ")"
C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4485) : error 029: invalid expression, assumed zero
C:\Users\hazza\OneDrive\Desktop\prp-master\gamemodes\Cock.pwn(4485) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
PhantomBird is offline   Reply With Quote
Old 15/10/2019, 01:51 PM   #4
Boarden
Little Clucker
 
Boarden's Avatar
 
Join Date: Jun 2014
Location: (Formerly Great) Britain
Posts: 32
Reputation: 4
Default Re: Please help why can't I compile gamemode?

What is on line 4485?
Boarden is offline   Reply With Quote
Old 15/10/2019, 02:07 PM   #5
PhantomBird
Little Clucker
 
Join Date: Aug 2017
Posts: 8
Reputation: 0
Default Re: Please help why can't I compile gamemode?

SendErrorMessage(playerid, "Your characters name must be at least 3 characters and no more than "#MAX_PLAYER_NAME" characters.");
PhantomBird is offline   Reply With Quote
Old 15/10/2019, 02:22 PM   #6
Boarden
Little Clucker
 
Boarden's Avatar
 
Join Date: Jun 2014
Location: (Formerly Great) Britain
Posts: 32
Reputation: 4
Default Re: Please help why can't I compile gamemode?

I may be wrong about this but...

As far as I am aware this is caused by MAX_PLAYER_NAME being defined as an integer as opposed to a character string. The same code works if for example you did something like

Code:
#define MAX_PLAYER_NAME_2 "24"

SendErrorMessage(playerid, "Your characters name must be at least 3 characters and no more than "#MAX_PLAYER_NAME_2" characters.");
This isn't something that is standard so I do not recommend doing this. (Please don't do this! This is just an example to explain why the code doesn't work.)

Alternatively you could do something like this:
Code:
new szErrorMsg[83]; // 82 characters long for the message + 1 for EOS.
format(szErrorMsg, sizeof(szErrorMsg), "Your characters name must be at least 3 characters and no more than %d characters.", MAX_PLAYER_NAME);

SendErrorMessage(playerid, szErrorMsg);
(or, looking at your script's code, you could probably simplify this to):
Code:
SendErrorMessage(playerid, "Your characters name must be at least 3 characters and no more than %d characters.", MAX_PLAYER_NAME);
Boarden is offline   Reply With Quote
Old 15/10/2019, 02:35 PM   #7
PhantomBird
Little Clucker
 
Join Date: Aug 2017
Posts: 8
Reputation: 0
Default Re: Please help why can't I compile gamemode?

Ok so now, I get no errors in the gamemode, but when I start my server it starts to an UNKNOWN GAMEMODE

and just spawns me in blueberry with a CJ skin.


Output shows this;
Script[gamemodes/Cock.amx]: Run time error 19: "File or function is not found"
PhantomBird is offline   Reply With Quote
Old 15/10/2019, 02:36 PM   #8
Boarden
Little Clucker
 
Boarden's Avatar
 
Join Date: Jun 2014
Location: (Formerly Great) Britain
Posts: 32
Reputation: 4
Default Re: Please help why can't I compile gamemode?

Quote:
Originally Posted by PhantomBird View Post
Ok so now, I get no errors in the gamemode, but when I start my server it starts to an UNKNOWN GAMEMODE

and just spawns me in blueberry with a CJ skin.


Output shows this;
Script[gamemodes/Cock.amx]: Run time error 19: "File or function is not found"
Do you have the right plugins for your gamemode?
__________________
Boarden is offline   Reply With Quote
Old 15/10/2019, 02:40 PM   #9
PhantomBird
Little Clucker
 
Join Date: Aug 2017
Posts: 8
Reputation: 0
Default Re: Please help why can't I compile gamemode?

How do I know what plugins I need :S
PhantomBird is offline   Reply With Quote
Old 15/10/2019, 02:43 PM   #10
Boarden
Little Clucker
 
Boarden's Avatar
 
Join Date: Jun 2014
Location: (Formerly Great) Britain
Posts: 32
Reputation: 4
Default Re: Please help why can't I compile gamemode?

Quote:
Originally Posted by PhantomBird View Post
How do I know what plugins I need :S
https://github.com/Zeex/samp-plugin-...etect/releases this plugin will tell you which functions are missing, that should help you figure out what you need.
__________________
Boarden is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I Can't Compile My Gamemode Z3nx31L Scripting Help 2 15/08/2019 10:14 AM
Gamemode can't compile houssam501 Scripting Help 4 30/01/2019 12:19 AM
Compile GameMode Ugaustin Scripting Help 8 05/09/2015 04:23 PM
why my pawno cannot compile my gamemode, it is keep stay at the compile output window Chrisli520 Scripting Help 5 19/10/2013 08:44 AM
Please help! Cant compile gamemode! Maartinshskd Scripting Help 6 03/03/2013 04:58 PM


All times are GMT. The time now is 02:19 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.