[Ajuda] Ajuda Rotas Jobs
#1

Olб eu queria criar um JOB mas nao sei onde devo colar este codigo:

Eu quero colar ele em 1 GM novo sem nada:

Comando ROTA

PHP код:
if(strcmp(cmd"/rota"true) == 0)
        {
            new 
vehicleid GetPlayerVehicleID(playerid);
            if(
GetVehicleModel(vehicleid) == 431)
            {
                if(
PlayerInfo[playerid][pJob] == 7)
                {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[CENTRAL:] Comeзaste a fazer a rota de autocarros.");
                    
SendClientMessageToAll(COLOR_LIGHTBLUE"Saiu da estaзгo de Las Barrancas neste momento um autocarro.");
                    
BusDriverRoute[playerid] = 1;
                    
SetPlayerCheckpoint(playerid, -812.4704,1436.0114,13.89095.0);
                    
IsBusRoute[playerid] = 1;
                }
            }
            else if(
GetVehicleModel(vehicleid) == 574)
            {
                if(
PlayerInfo[playerid][pJob] == 9)
                {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[CENTRAL:] Bom dia de trabalho, pode comeзar a limpar as ruas do vale!");
                    
TruckerRoute[playerid] = 1;
                    
SetPlayerCheckpoint(playerid, -846.6721,1448.8314,14.34965.0);
                    
IsTruckerRoute[playerid] = 1;
                }
            }
            else if(
GetVehicleModel(vehicleid) == 408)
             {
                 if(
PlayerInfo[playerid][pJob] == 8)
                 {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[CENTRAL:] Comeзaste a fazer a rota de recolha de lixo pelo vale!");
                    
TruckerTrashRoute[playerid] = 1;
                    
CreateCheckpoint(playerid,-187.7849,1043.5240,20.1602,5.0); //
                    
IsTruckerTrashRoute[playerid] = 1;
                }
            }
            else if(
DynamicCars[vehicleid-1][CarType] == 4)
             {
                 if(
PlayerInfo[playerid][pJob] == 15 || PlayerInfo[playerid][pBizKey] == 8)
                 {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[Dono Da Quinta:] Leva estes Cereais ate o Moinho e volta para cб!");
                    
tcRoute[playerid] = 1;
                    
CreateCheckpoint(playerid,251.8076,1114.2485,11.6121,5.0); //
                    
IstcRoute[playerid] = 1;
                }
            }
            else if(
DynamicCars[vehicleid-1][CarType] == 5)
             {
                 if(
PlayerInfo[playerid][pJob] == 16)
                 {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[CENTRAL:] Comeзaste a fazer a rota de entrega de cartas!");
                    
carteiroRoute[playerid] = 1;
                    
CreateCheckpoint(playerid,-317.1532,2687.5029,62.2059,5.0); //
                    
IscarteiroRoute[playerid] = 1;
                }
            }
            return 
1;
        } 
GameMode

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
string[256];
    new 
cmd[256];
    new 
idx;
Linha43    cmd strtok(cmdtextidx);
    new 
tmp[256];
     new 
giveplayerid;
Linha46    if(gPlayerLogged[playerid] == 1)
    
    {
        if(
strcmp(cmd"/rota"true) == 0)
        {
            new 
vehicleid GetPlayerVehicleID(playerid);
            if(
GetVehicleModel(vehicleid) == 431)
            {
                if(
PlayerInfo[playerid][pJob] == 7)
                {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[CENTRAL:] Comeзaste a fazer a rota de autocarros.");
                    
SendClientMessageToAll(COLOR_LIGHTBLUE"Saiu da estaзгo de Las Barrancas neste momento um autocarro.");
                    
BusDriverRoute[playerid] = 1;
                    
SetPlayerCheckpoint(playerid, -812.4704,1436.0114,13.89095.0);
                    
IsBusRoute[playerid] = 1;
                }
            }
            else if(
GetVehicleModel(vehicleid) == 574)
            {
                if(
PlayerInfo[playerid][pJob] == 9)
                {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[CENTRAL:] Bom dia de trabalho, pode comeзar a limpar as ruas do vale!");
                    
TruckerRoute[playerid] = 1;
                    
SetPlayerCheckpoint(playerid, -846.6721,1448.8314,14.34965.0);
                    
IsTruckerRoute[playerid] = 1;
                }
            }
            else if(
GetVehicleModel(vehicleid) == 408)
             {
                 if(
PlayerInfo[playerid][pJob] == 8)
                 {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[CENTRAL:] Comeзaste a fazer a rota de recolha de lixo pelo vale!");
                    
TruckerTrashRoute[playerid] = 1;
                    
CreateCheckpoint(playerid,-187.7849,1043.5240,20.1602,5.0); //
                    
IsTruckerTrashRoute[playerid] = 1;
                }
            }
            else if(
DynamicCars[vehicleid-1][CarType] == 4)
             {
                 if(
PlayerInfo[playerid][pJob] == 15 || PlayerInfo[playerid][pBizKey] == 8)
                 {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[Dono Da Quinta:] Leva estes Cereais ate o Moinho e volta para cб!");
                    
tcRoute[playerid] = 1;
                    
CreateCheckpoint(playerid,251.8076,1114.2485,11.6121,5.0); //
                    
IstcRoute[playerid] = 1;
                }
            }
            else if(
DynamicCars[vehicleid-1][CarType] == 5)
             {
                 if(
PlayerInfo[playerid][pJob] == 16)
                 {
                     if(
PlayerInfo[playerid][pJobWait] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERRO:] Acabaste de trabalhar, vai descansar um pouco!");
                        return 
1;
                    }
                    
SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[CENTRAL:] Comeзaste a fazer a rota de entrega de cartas!");
                    
carteiroRoute[playerid] = 1;
                    
CreateCheckpoint(playerid,-317.1532,2687.5029,62.2059,5.0); //
                    
IscarteiroRoute[playerid] = 1;
                }
            }
            return 
1;
        }
    } 
Quando adiciono isto no meu Gamemode aparece isto

PHP код:
C:\Users\Bruno\Desktop\Untitled.pwn(43) : error 017undefined symbol "strtok"
C:\Users\Bruno\Desktop\Untitled.pwn(43) : error 033: array must be indexed (variable "cmd")
C:\Users\Bruno\Desktop\Untitled.pwn(46) : error 017undefined symbol "gPlayerLogged"
C:\Users\Bruno\Desktop\Untitled.pwn(46) : warning 215expression has no effect
C
:\Users\Bruno\Desktop\Untitled.pwn(46) : error 001expected token";"but found "]"
C:\Users\Bruno\Desktop\Untitled.pwn(46) : error 029invalid expressionassumed zero
C
:\Users\Bruno\Desktop\Untitled.pwn(46) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
6 Errors

Tambem queria saber como eu mudo os checkpoints/cordenadas

@EDIT
Reply
#2

Ela esta random!

pawn Код:
SetPlayerCheckpoint(playerid, Coord X, Coord Y, Coord Z,Tamanho do Check);
Reply
#3

Como assim random?
Reply
#4

Toda vez que vocк usar este comando ele sera sorteado uma rota a vocК!
Reply
#5

Acho que como o Don_Speed disse, cada vez que fizeres /rota , ele seleccionarб uma rota ao calhas ... acho que й isso
Reply
#6

Desculpem foi editado o tipo revejam pls
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)