[Req] Convert to dynamic .
#1

Hi guys.
How to convert this code to dynamic ?
Код:
forward GCPT(playerID);
public GCPT(playerID)
{
	return checkpointType[playerCheckpoint[playerID]];
}
Thanks
Reply
#2

PHP код:
#define GCPT(%0)        (checkpointType[playerCheckpoint[(%0)]]) 
Reply
#3

No.
It is my code :
Код:
forward GCPT(playerID);
public GCPT(playerID)
{
	return checkpointType[playerCheckpoint[playerID]];
}

if(GCPT(playerid) != SpGp)
{
    SendClientMessage(playerid,COLOR_ERROR,"Test");
    return 1;
}
I want to convert it to Streamer.
Reply
#4

I don't know how you've defined SpGp, but if it's a string:
pawn Код:
forward GCPT(playerID);
public GCPT(playerID)
{
    return checkpointType[playerCheckpoint[playerID]];
}

if(GCPT(playerid) != "SpGp")
{
    SendClientMessage(playerid,COLOR_ERROR,"Test");
    return 1;
}
Reply
#5

Код:
SpGp = CreateDynamicCP(2174.5442, 90.5050, 29.2097,2,-1,-1,-1,100);

forward GCPT(playerID);

public GCPT(playerID)
{
	return checkpointType[playerCheckpoint[playerID]];
}

if(GCPT(playerid) != SpGp)
{
    SendClientMessage(playerid,COLOR_ERROR,"Test");
    return 1;
}
Reply
#6

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
return 1;
}
Reply
#7

Код:
forward GCPT(playerID);
Код:
SpGp = CreateDynamicCP(2174.5442, 90.5050, 29.2097,2,-1,-1,-1,100);
Код:
public GCPT(playerID)
{
	return checkpointType[playerCheckpoint[playerID]];
}

public GiveMoneySpawnTok(playerid,params[])
{
    #pragma unused params
	new string[128];
    if(GCPT(playerid) != SpGp)
    {
        SendClientMessage(playerid,COLOR_ERROR,"Test");
        return 1;
    }
	.
    .
	.
	.
	.
	.
    return 1;
}
I change the GCPT(playerid) to what? (For dynamic "Streamer")
Reply
#8

You don't need GCPT in Streamer

pawn Код:
if(checkpointid != SpGp)
{
    SendClientMessage(playerid,COLOR_ERROR,"Test");
    return 1;
}
or in some commands

pawn Код:
if(!IsPlayerInDynamicCP(playerid, SpGp))
{
    SendClientMessage(playerid,COLOR_ERROR,"Test");
    return 1;
}
Reply
#9

Quote:
Originally Posted by Jefff
Посмотреть сообщение
You don't need GCPT in Streamer

pawn Код:
if(checkpointid != SpGp)
{
    SendClientMessage(playerid,COLOR_ERROR,"Test");
    return 1;
}
playerid ?
EDIT: : error 017: undefined symbol "checkpointid"
Reply
#10

Check previous post and next time show full code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)