[Ajuda] Detectar se o player esta no checkpoint
#1

Pessoal, como verifico se o player esta dentro do checkpoint e mando pra ele para um interior?

ja adicionei no OnGameModeInt:
pawn Code:
new Conv_P_1 = CPS_AddCheckpoint(-78.452186,-1169.856323,2.137668, 1.0, 40);//Conveniencia Posto 1
Ai como verifico, na public OnPlayerEnterCheckpoint, se o player esta no checkpont "Conv_P_1" para dps usar:
pawn Code:
SetPlayerVirtualWorld(playerid, 10);
SetPlayerInterior(playerid, 17);
E isso ae galera, Vlw, Flw.
Reply
#2

dentro da OnPlayerEnterCheckpoint vocк poe
pawn Code:
if(chekpointid == Conv_P_1)
{
SetPlayerVirtualWorld(playerid, 10);
SetPlayerInterior(playerid, 17);
}
Reply
#3

Quote:
Originally Posted by hard_dalzot
View Post
dentro da OnPlayerEnterCheckpoint vocк poe
pawn Code:
if(chekpointid == Conv_P_1)
{
SetPlayerVirtualWorld(playerid, 10);
SetPlayerInterior(playerid, 17);
}
pawn Code:
C:\Users\Usuario\Desktop\Server SAMP 0.3z\gamemodes\GM.pwn(119) : warning 204: symbol is assigned a value that is never used: "Conv_P_1"
C:\Users\Usuario\Desktop\Server SAMP 0.3z\gamemodes\GM.pwn(384) : error 017: undefined symbol "chekpointid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Falta alguma include??

@EDIT.

Minhas includes:
pawn Code:
#include a_samp
#include DOF2
#include progressbar
#include sscanf2
#include cpstream
@EDIT2

Help??
Reply
#4

cria uma variбvel para definir em qual checkpoint o player tem que ir ex:
pawn Code:
//topo do gm
new ChekPoint[MAX_PLAYERS];
new Conv_P_1;

//onplayerspawn
Conv_P_1 = SetPlayerCheckpoint(playerid, -78.452186,-1169.856323,2.137668, 1.0);//Conveniencia Posto 1

//onplayerconnect
CheckPoint[playerid] = 0;

//onplayerentercheckpoint
if(CheckPoint[playerid] == Conv_P_1)
{
CheckPoint[playerid] = 0;
SendClientMessage(playerid, -1, "Bem vindo a conveniencia do posto 1");
SetPlayerVirtualWorld(playerid, 10);
SetPlayerInterior(playerid, 17);
}
tenta algo assim
Reply
#5

Esse CPS_AddCheckpoint й de alguma biblioteca de seu gamemode, essa funзгo nгo й padrгo do SA-MP.

https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint
pawn Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
    GivePlayerMoney(playerid, 1000);
    DisablePlayerCheckpoint(playerid);
    return 1;
}
Reply
#6

Aqui amigo:

pawn Code:
public OnPlayerEnterCheckpoint(playerid)
{
new checknome = CPS_GetPlayerCheckpoint(playerid);
if(checknome == Conv_P_1)
{
SetPlayerVirtualWorld(playerid, 10);
SetPlayerInterior(playerid, 17);
return 1;
}
}
OBS: Se der 26 erros tire uma "}".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)