[Ayuda] Trabajo cartero
#7

Quote:
Originally Posted by Zume-Zero
Посмотреть сообщение
pawn Код:
new VehiCart;
new cart[MAX_PLAYERS];
public OnGameModeInit()
{
    VehiCart = CreateVehicle(509, 1805.5453, -1902.0564, 12.8976, 84.0000, -1, -1, 100);
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    if(vehicleid == VehiCart && cart[playerid] != 0)
    {
        return 1;
    }
    else
    {
        SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        SendClientMessage(playerid, red, "No tienes el oficio de Cartero");
    }
    return 1;
}
Hey! gracias por respoder!
Probй el cуdigo y me dio estos errores
Код:
C:\Users\LENOVO\Desktop\Dan\Todo gta San Andreas\Server\gamemodes\ProbandoFunciones.pwn(157) : error 033: array must be indexed (variable "cart")
C:\Users\LENOVO\Desktop\Dan\Todo gta San Andreas\Server\gamemodes\ProbandoFunciones.pwn(158) : error 033: array must be indexed (variable "cart")
C:\Users\LENOVO\Desktop\Dan\Todo gta San Andreas\Server\gamemodes\ProbandoFunciones.pwn(168) : error 033: array must be indexed (variable "cart")
C:\Users\LENOVO\Desktop\Dan\Todo gta San Andreas\Server\gamemodes\ProbandoFunciones.pwn(168) : error 033: array must be indexed (variable "cart")
Es en el comando para tomar el trabajo, probй cambiando cart = 1; por cart[playerid] = 1;
Me quitу los errores pero en el juego, a la hora de montarme a la bici (sin tener el trabajo) me sale un letrero que dice "Stay whitin Boundrie World" algo asн, y me pausa el juego, empiza a ir super lento y el brillo empieza a aclararse a tal punto que todo se ve blanco

Quote:
Originally Posted by OTACON
Посмотреть сообщение
pawn Код:
#include <a_samp>

new VehiCart,
bool:cart[MAX_PLAYERS];

public OnGameModeInit(){
    VehiCart = AddStaticVehicleEx(509, 1805.5453, -1902.0564, 12.8976, 84.0000, -1, -1, 100);
    return true;
}
public OnPlayerStateChange(playerid, newstate, oldstate){
    if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER){
        new vehicleid = GetPlayerVehicleID(playerid);
        if(vehicleid == VehiCart && cart[playerid] != false){
        //TU FUNCION
        }else{SendClientMessage(playerid, red, "No tienes el oficio de Cartero");}
    }
    return true;
}
https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
https://sampwiki.blast.hk/wiki/OnPlayerStateChange
Gracias por responder!!
Tambiйn me sale el error las lнneas del comando /cartero
Lo cambiй tambiйn a cart[playerid] = 1;
Pero a la hora de entrar al juego no me funciona.

dices que aqui va la funciуn para que no pueda subir a la bici?:

pawn Код:
if(vehicleid == VehiCart && cart[playerid] != false){
        //TU FUNCION aqui?
        }else{SendClientMessage(playerid, red, "No tienes el oficio de Cartero");//yo pensarнa que es aqui}
Bueno intentй pondiendo SetVehicleParamsForPlayer(vehicleid,playerid,0,1); en donde dijiste, no hizo nada, e intentй como yo pensй que era:

pawn Код:
if(vehicleid == VehiCart && cart[playerid] != false){
        SetVehicleParamsForPlayer(vehicleid,playerid,0,0);
        }else{SetVehicleParamsForPlayer(vehicleid,playerid,0,1); SendClientMessage(playerid, BLANCO, "No tienes el oficio de Cartero");}
Y tampoco funcionу

Si me quieren ayudar mejor, les puedo mandar el archivo .pwn para que lo vean todo.

PD: CrossOv3r no entendн xD
Reply


Messages In This Thread
[Ayuda] Trabajo cartero - by Casvill - 07.01.2014, 20:22
Respuesta: [Ayuda] Trabajo cartero - by Porta0123 - 07.01.2014, 21:14
Respuesta: [Ayuda] Trabajo cartero - by Casvill - 08.01.2014, 00:02
Respuesta: [Ayuda] Trabajo cartero - by Zume - 08.01.2014, 00:08
Respuesta: [Ayuda] Trabajo cartero - by OTACON - 08.01.2014, 00:20
Respuesta: [Ayuda] Trabajo cartero - by CrossOv3r - 08.01.2014, 00:24
Respuesta: [Ayuda] Trabajo cartero - by Casvill - 08.01.2014, 03:40
Respuesta: [Ayuda] Trabajo cartero - by Zume - 08.01.2014, 04:02

Forum Jump:


Users browsing this thread: 1 Guest(s)