How to make a code for check player position to show checkpoint
#1

i have door faction and door have info of position
En1X-Z and Ex1X-Z is position of door

Код:
enum E_DOOR
{
	DoorName[MAX_DOOR_NAME+1],
	DoorStat,
	Float:En1X,
	Float:En1Y,
	Float:En1Z,
	Float:En2X,
	Float:En2Y,
	Float:En2Z,
	Float:En2A,
	En2I,
	Float:Ex1X,
	Float:Ex1Y,
	Float:Ex1Z,
	Float:Ex2X,
	Float:Ex2Y,
	Float:Ex2Z,
	Float:Ex2A,
	Ex2I
}
enum E_FAC
{
	ORM:fORM_ID,
	fID,
	fName[MAX_FACTION_NAME+1],
	Float:fSp[4],
	fSpI,
	fLevel,
	fRespect,
	fMoney,
	fDoor[E_DOOR],
	fSkin[5],
	fMis[5],
	fEquip[10],
}
new Faction[MAX_FACTION][E_FAC];
i have no idea to code how about onplayerupdate to check position whatever when player is near whatever door
how to easy code array too hard

Код:
public OnPlayerUpdate(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 5, Faction[][fDoor][2], Faction[][fDoor][3], Faction[][fDoor][4]))
	{
	    SetPlayerCheckPoint(playerid, Faction[][fDoor][2], Faction[][fDoor][3], Faction[][fDoor][4], 3);
	}
	return 1;
}
Reply
#2

Faction[faction memory ID][fDoor][En1X] ... Faction[faction memory ID][fDoor][Ex2Z]

Example:

Код:
Faction[14][fDoor][En1X] = 2.4
Reply
#3

that is mean i must typing id faction .. fac by fac ? right ?
Reply
#4

Quote:

public OnPlayerUpdate(playerid)
{
if(GetPlayerMoney(playerid) != Player[playerid][pCash]) { SafeGivePlayerMoney(playerid, 0); }
if(IsPlayerInRangeOfPoint(playerid, 8, Faction[3][fDoor][2], Faction[3][fDoor][3], Faction[3][fDoor][4])) { SetPlayerCheckPoint(playerid, Faction[3][fDoor][2], Faction[3][fDoor][3], Faction[3][fDoor][4], 3.0); }
return 1;
}

C:\Users\KAPU\Desktop\samp03x_svr_R2_win32\gamemod es\TheGodfather2.pwn(541) : warning 213: tag mismatch
C:\Users\KAPU\Desktop\samp03x_svr_R2_win32\gamemod es\TheGodfather2.pwn(541) : warning 213: tag mismatch
C:\Users\KAPU\Desktop\samp03x_svr_R2_win32\gamemod es\TheGodfather2.pwn(541) : warning 213: tag mismatch
C:\Users\KAPU\Desktop\samp03x_svr_R2_win32\gamemod es\TheGodfather2.pwn(541) : error 017: undefined symbol "SetPlayerCheckPoint"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)