SA-MP Forums Archive
Litle help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Litle help (/showthread.php?tid=585925)



Litle help - Ciyber - 17.08.2015

Hello, i need litle help, i have no idea whats the problem.



my includes
PHP код:
#include <a_samp>
#include <cpstream>
#include <dini>
#include <zcmd> 
also the 'new' think..

PHP код:
new Text3D:TOwner[MAX_PLAYERS];
new 
Name[MAX_PLAYER_NAME];
new 
File[256];
new 
SpawnedCar[MAX_PLAYERS];
new 
pCar[MAX_PLAYERS];
#define Cars "CarShop/%s.ini"
new CarCP[MAX_PLAYERS]; 



Re: Litle help - Aleksabre - 17.08.2015

have you made in 'new' function at the top of the script?


Re: Litle help - UnDetectable - 17.08.2015

You didn't define 'CarCP'
Put at the top of the script
Код:
new CarCP[MAX_PLAYERS];
And another thing may cause you a problem
You've used 'CarCP' for two different things

Firstly to create a CP
And secondly you've set it to 0


Re: Litle help - Ciyber - 17.08.2015

Quote:
Originally Posted by Aleksabre
Посмотреть сообщение
have you made in 'new' function at the top of the script?
of course, lol


Quote:
Originally Posted by UnDetectable
Посмотреть сообщение
You didn't define 'CarCP'
Put at the top of the script
Код:
new CarCP[MAX_PLAYERS];
And another thing may cause you a problem
You've used 'CarCP' for two different things

Firstly to create a CP
And secondly you've set it to 0
I've change it to 1, and the same problem

I think i need to rescript the whole gamemode now


Re: Litle help - xVIP3Rx - 17.08.2015

Try changing the name, and declare it right before the function
pawn Код:
new blabla[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    blabla[playerid] = 1;
//...



Re: Litle help - UnDetectable - 18.08.2015

Quote:

I've change it to 1, and the same problem

I meant that you used 'CarCP' twice for different things
How about leave CarCP for the checkpoint
and create another variable
for example

Код:
new CarCP[MAX_PLAYERS];
new PlayerCarCP[MAX_PLAYERS];

CarCP[playerid] = CP_AddCheck.......
PlayerCarCP[playerid] = 0;
Another question, are you just trying to create a checkpoint ? if no what exactly you are trying to do ?
if yes just remove all of this and create this:

Код:
new CarCP;

public OnGameModeInit()
{
    CarCP = CP_AddCheckpoint(........);
    return 1;
}