[HELP]Making checkpoint -
Thebest96 - 17.08.2010
I some questions: How to make a Bus driver job. DOn't need commands, only how to create.
Then you know when you do /startroute and the checkpoint's starts and you need to enter it. I wan't know how to this too.
Please helpme
PS. If you teatchme out to do this i will map for you for free.
Re: [HELP]Making checkpoint -
Sascha - 17.08.2010
at the top of your script:
Код:
new state[MAX_PLAYERS];
then for the command to start:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/startroute", cmdtext, true, 10) == 0)
{
if(state[playerid] = 0){
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 1. route point
state[playerid] = 1;
return 1;
}
}
return 0;
}
then to get the checkpoints and continue with the route:
Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(state[playerid] == 1){
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 2. route point
state[playerid]++;
}else if(state[playerid] == 2){
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 3. route point
state[playerid]++;
}else if(state[playerid] == 3){
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 4. route point
state[playerid]++;
}
return 1;
}
You can continue with the "else if(state[playerid] == x)" as far as you want... just increase the number by 1 always and at your last checkpoint do this:
Код:
DisablePlayerCheckpoint(playerid);
state[playerid] = 0;
instead of the SetPlayerCheckpoint and the state[playerid]++, otherwise you won't be able to use the command again, later
oh.. and btw.. I don't need a mapper
..
if you have anymore questions related to this just send me a pm
Re: [HELP]Making checkpoint -
Thebest96 - 17.08.2010
Quote:
Originally Posted by Sascha
at the top of your script:
Код:
new state[MAX_PLAYERS];
then for the command to start:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/startroute", cmdtext, true, 10) == 0)
{
if(state[playerid] = 0){
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 1. route point
state[playerid] = 1;
return 1;
}
}
return 0;
}
then to get the checkpoints and continue with the route:
Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(state[playerid] == 1){
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 2. route point
state[playerid]++;
}else if(state[playerid] == 2){
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 3. route point
state[playerid]++;
}else if(state[playerid] == 3){
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 4. route point
state[playerid]++;
}
return 1;
}
You can continue with the "else if(state[playerid] == x)" as far as you want... just increase the number by 1 always and at your last checkpoint do this:
Код:
DisablePlayerCheckpoint(playerid);
state[playerid] = 0;
instead of the SetPlayerCheckpoint and the state[playerid]++, otherwise you won't be able to use the command again, later
oh.. and btw.. I don't need a mapper ..
if you have anymore questions related to this just send me a pm
|
VERY THANKS I LOVE YOU!
Re: [HELP]Making checkpoint -
Thebest96 - 17.08.2010
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(4) : error 020: invalid symbol name ""
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(95) : error 001: expected token: "-identifier-", but found "["
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(95) : error 029: invalid expression, assumed zero
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(95) : warning 215: expression has no effect
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(95) : error 001: expected token: ";", but found "]"
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(95) : fatal error 107: too many error messages on one line
Re: [HELP]Making checkpoint -
Steven82 - 17.08.2010
Thanks for not showing us the lines becuz that really helps.............
Re: [HELP]Making checkpoint -
PotH3Ad - 18.08.2010
This should fix the warnings:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/startroute", true, 11))
{
if(state[playerid] == 0)
{
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 1. route point
state[playerid] = 1;
return 1;
}
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
switch(state[playerid])
{
case 1:
{
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 2. route point
state[playerid]++;
}
case 2:
{
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 3. route point
state[playerid]++;
}
case 3:
{
SetPlayerCheckpoint(playerid, x, y, z, 5.00); //replace x, y, z with the coordinates of the 4. route point
state[playerid]++;
}
}
return 1;
}
Quote:
Originally Posted by Steven82
Thanks for not showing us the lines becuz that really helps.............
|
The code is posted above...
Re: [HELP]Making checkpoint -
Thebest96 - 18.08.2010
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(4) : error 020: invalid symbol name ""
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(93) : error 029: invalid expression, assumed zero
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(93) : error 029: invalid expression, assumed zero
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(94) : warning 217: loose indentation
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(97) : error 001: expected token: "-identifier-", but found "["
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(97) : error 029: invalid expression, assumed zero
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(97) : warning 215: expression has no effect
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(97) : error 001: expected token: ";", but found "]"
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\filterscripts\FS bus.pwn(97) : fatal error 107: too many error messages on one line
Re: [HELP]Making checkpoint -
ikey07 - 18.08.2010
More easly way
pawn Код:
new BusCP[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
BusCP[playerid] = 9999;
}
new Float:BusStops[10][3] = {
{x,y,z),
{x,y,z),
{x,y,z),
{x,y,z),
{x,y,z),
{x,y,z),
{x,y,z),
{x,y,z),
{x,y,z),
{x,y,z)
};
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/startroute", cmdtext, true, 10) == 0)
{
if(BusCP[playerid] == 9999)
{
SetPlayerRaceCheckpoint(playerid,0,BusStop[0][0],BusStop[0][1],BusStop[0][2],BusStop[1][0],BusStop[1][1],BusStop[1][2],5.00);
BusCP[playerid] = 0;
return 1;
}
else
{
SendClientMessage(playerid,COLOR,"You are already on route!");
}
}
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(BusCP[playerid] < 9999)
{
BusCP[playerid]++;
new b = BusCP[playerid];
if(b == 9)
{
SendClientMessage(playerid,COLOR,"You end the route.");
}
else if(b <= 7)
{
SetPlayerRaceCheckpoint(playerid,0,BusStop[b][0],BusStop[b][1],BusStop[b][2],BusStop[b+1][0],BusStop[b+1][1],BusStop[b+1][2],5);
}
else
{
SetPlayerRaceCheckpoint(playerid,1,BusStop[b][0],BusStop[b][1],BusStop[b][2],BusStop[b+1][0],BusStop[b+1][1],BusStop[b+1][2],5);
}
}
return 1;
}
with this you dont need on checkpoints else if else if, because Bus routes usual is about 10+ stops, so for each bus stop else if, is abit masive
Re: [HELP]Making checkpoint -
Thebest96 - 18.08.2010
OHHH thanks
Re: [HELP]Making checkpoint -
Thebest96 - 18.08.2010
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\bus.pwn(11) : error 001: expected token: ";", but found ")"
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\bus.pwn(173) : error 017: undefined symbol "BusStop"
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\bus.pwn(173) : warning 215: expression has no effect
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\bus.pwn(173) : error 001: expected token: ";", but found "]"
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\bus.pwn(173) : error 029: invalid expression, assumed zero
C:\Users\Antonio Carlos\Desktop\Nuno\gta sa\gamemodes\bus.pwn(173) : fatal error 107: too many error messages on one line
All errors in this line:
SetPlayerRaceCheckpoint(playerid,0,BusStop[0][0],BusStop[0][1],BusStop[0][2],BusStop[1][0],BusStop[1][1],BusStop[1][2],5.00);