SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 11/11/2017, 07:43 AM   #4451
axellech
Big Clucker
 
Join Date: Mar 2016
Posts: 187
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Is it possible to put the server maps out of gamemode? without filterscript?
What code do I have to do to do this?

like:
PHP Code:
"#include         "..modules\maps\house.pwn
But if I do, what, what code should I put in house.pwn to put the map in?
axellech is offline   Reply With Quote
Old 11/11/2017, 08:13 AM   #4452
Eoussama
High-roller
 
Eoussama's Avatar
 
Join Date: Jul 2016
Location: Kingdom of Morocco // Tangier
Posts: 1,271
Reputation: 247
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by axellech View Post
Is it possible to put the server maps out of gamemode? without filterscript?
What code do I have to do to do this?

like:
PHP Code:
"#include         "..modules\maps\house.pwn
But if I do, what, what code should I put in house.pwn to put the map in?
Yes, it should be as followed.
PHP Code:
//house.pwn

CreateHouses()
{
        
CretaeDynamicObject(.....);
        
CretaeDynamicObject(.....);
        
CretaeDynamicObject(.....);
        
//.....
        
CretaeDynamicObject(.....);
        
CretaeDynamicObject(.....);

PHP Code:
//your gaemode file

OnGamemodeInIt()
{
        
CreateHouses();

        return 
1;

__________________

|===[Web taxi]===|
List of my work
Github
Pastebin

|===[Interesting topics]===|
Semantic Versioning


Eoussama is offline   Reply With Quote
Old 11/11/2017, 08:45 AM   #4453
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,947
Reputation: 1510
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by axellech View Post
Is it possible to put the server maps out of gamemode? without filterscript?
What code do I have to do to do this?

like:
PHP Code:
"#include         "..modules\maps\house.pwn
But if I do, what, what code should I put in house.pwn to put the map in?
Those paths are relative to the script it's compiled from, so if it's in ./gamemodes/ then it will be relative to there. Also, small typo in the path: ..modules should be ..\modules. If you want an example of a production modular gamemode check this out!
__________________
Tools:

Plugins:

Links:

[HLF]Southclaw is offline   Reply With Quote
Old 12/11/2017, 03:07 PM   #4454
axellech
Big Clucker
 
Join Date: Mar 2016
Posts: 187
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Eoussama View Post
Yes, it should be as followed.
PHP Code:
//house.pwn

CreateHouses()
{
        
CretaeDynamicObject(.....);
        
CretaeDynamicObject(.....);
        
CretaeDynamicObject(.....);
        
//.....
        
CretaeDynamicObject(.....);
        
CretaeDynamicObject(.....);

PHP Code:
//your gaemode file

OnGamemodeInIt()
{
        
CreateHouses();

        return 
1;

Thank you <3
axellech is offline   Reply With Quote
Old 16/11/2017, 07:21 PM   #4455
axellech
Big Clucker
 
Join Date: Mar 2016
Posts: 187
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

How to put a custom texture on "room decorating images" objects?
"custom images into object, how to do this?"
axellech is offline   Reply With Quote
Old 20/11/2017, 03:27 PM   #4456
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: 666
Posts: 1,493
Reputation: 267
Default Re: Little coding questions - For general minor queries 5

i need some help here
PHP Code:
error 001expected token"-string end-"but found "-identifier-"
warning 215expression has no effect
error 001
expected token";"but found ")"
error 029invalid expressionassumed zero
fatal error 107
too many error messages on one line 
non-formatted messages work fine, using format causes the above mentioned problems.

all these errors coming from
PHP Code:
new str[70];
format(strsizeof str"You can't chat while you're muted, you must wait %d seconds."PlayerStat[playerid][MuteTime]);
SendErrorMessage(playeridstr); // this line 
definition of SendErrorMessage
PHP Code:
#define SendErrorMessage(%1,%2) \
    
SendClientMessage(%1COLOR_PINK"[ERROR] {FFFFFF} " %2
__________________
Premium quality and reasonable pricing game Server hosting
Logic_ is offline   Reply With Quote
Old 20/11/2017, 04:10 PM   #4457
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,915
Reputation: 256
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Logic_ View Post
i need some help here
PHP Code:
error 001expected token"-string end-"but found "-identifier-"
warning 215expression has no effect
error 001
expected token";"but found ")"
error 029invalid expressionassumed zero
fatal error 107
too many error messages on one line 
non-formatted messages work fine, using format causes the above mentioned problems.

all these errors coming from
PHP Code:
new str[70];
format(strsizeof str"You can't chat while you're muted, you must wait %d seconds."PlayerStat[playerid][MuteTime]);
SendErrorMessage(playeridstr); // this line 
definition of SendErrorMessage
PHP Code:
#define SendErrorMessage(%1,%2) \
    
SendClientMessage(%1COLOR_PINK"[ERROR] {FFFFFF} " %2
Because your code compile as :
PHP Code:
    new str[70]; 
    
format(strsizeof str"You can't chat while you're muted, you must wait %d seconds."PlayerStat[playerid][MuteTime]); 
    
SendClientMessage(playeridCOLOR_PINK"[ERROR] {FFFFFF} "  str); 
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 20/11/2017, 05:28 PM   #4458
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: 666
Posts: 1,493
Reputation: 267
Default Re: Little coding questions - For general minor queries 5

I, of course do know that, but what I need here is a solution... You're not helping me.
__________________
Premium quality and reasonable pricing game Server hosting
Logic_ is offline   Reply With Quote
Old 20/11/2017, 05:32 PM   #4459
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Posts: 1,681
Reputation: 168
Default Re: Little coding questions - For general minor queries 5

Code:
SendClientMessage(%1, COLOR_PINK, "[ERROR] {FFFFFF}  %2")
__________________
Ritzy2K is offline   Reply With Quote
Old 20/11/2017, 05:39 PM   #4460
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: 666
Posts: 1,493
Reputation: 267
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Ritzy View Post
Code:
SendClientMessage(%1, COLOR_PINK, "[ERROR] {FFFFFF}  %2")
Already fucking tried it, it won't help either.
__________________
Premium quality and reasonable pricing game Server hosting
Logic_ 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
how to make a soldier aotumaticly be general when the general dies ? AlbanianGuy Scripting Help 35 13/05/2012 03:35 PM
Minor problem Desert Help Archive 4 17/03/2010 06:24 PM
Counting with mysql queries actiwe Help Archive 2 26/02/2010 02:36 PM
SQL queries using GROUP BY Dabombber Help Archive 2 05/10/2009 07:47 PM


All times are GMT. The time now is 06:06 AM.


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