Jump to content
  • 0

Problema checkpoint


k3nw00d_kri5ty

Question

6 answers to this question

Recommended Posts

CMD:find(playerid, params[])
{
    new points, level = PlayerInfo[playerid][pDetSkill], Float:X, Float:Y, Float:Z;
    tmp = strtok(params, idx); giveplayerid = ReturnUser(tmp);
    if(PlayerInfo[playerid][pJob] != 1) return SendClientMessage(playerid, COLOR_GREY, "You are not Detective.");
	if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401) return SendClientMessage(playerid, COLOR_GREY, "You've already searched for someone, wait 2 minutes !");
	if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, "USAGE: /find [playerid/PartOfName]");
	if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_BROWN, "That player is not connected.");
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if(giveplayerid == playerid) return 1;
		if(level >= 0 && level <= 50) { points = 4; }
		else if(level >= 51 && level <= 100) { points = 6; }
		else if(level >= 101 && level <= 200) { points = 8; }
		else if(level >= 201 && level <= 400) { points = 10; }
		else if(level >= 401) { points = 12; }
	    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerPos(giveplayerid, X,Y,Z);
		SetPlayerCheckpoint(playerid, X,Y,Z, 6);
		FindTime[playerid] = 1;
		FindTimePoints[playerid] = points;
		UsedFind[playerid] = 1;
	}
    return 1;
}

Link to comment
Share on other sites

new CautareJucator[MAX_PLAYERS];

OnPlayerConnect: CautareJucator[playerid] = -1;

OnPlayerDisconnect:

	for(new i = 0; i < GetMaxPlayers(); i++)
	{
		if(IsPlayerConnected(i) && CautareJucator[i] == playerid)
		{
			CautareJucator[i] = -1;
			SendClientMessage(i, COLOR_YELLOW, "Jucatoru pe care il cautai a iesit de pe server !");
		}
	}
public OnPlayerUpdate(playerid)
{
	if( IsPlayerConnected(playerid) )
	{
		if( CautareJucator[playerid] != -1 )
		{
			if( IsPlayerConnected(CautareJucator[playerid]) )
			{
				new Float:X, Float:Y, Float:Z;
				GetPlayerPos(CautareJucator[playerid], X, Y, Z);
				SetPlayerCheckpoint(playerid, X, Y, Z, 6);
			}
		}
	}
	return 1;
}

i0418xcttya707ofg.jpg

Link to comment
Share on other sites

new CautareJucator[MAX_PLAYERS];

OnPlayerConnect: CautareJucator[playerid] = -1;

OnPlayerDisconnect:

	for(new i = 0; i < GetMaxPlayers(); i++)
	{
		if(IsPlayerConnected(i) && CautareJucator[i] == playerid)
		{
			CautareJucator[i] = -1;
			SendClientMessage(i, COLOR_YELLOW, "Jucatoru pe care il cautai a iesit de pe server !");
		}
	}
public OnPlayerUpdate(playerid)
{
	if( IsPlayerConnected(playerid) )
	{
		if( CautareJucator[playerid] != -1 )
		{
			if( IsPlayerConnected(CautareJucator[playerid]) )
			{
				new Float:X, Float:Y, Float:Z;
				GetPlayerPos(CautareJucator[playerid], X, Y, Z);
				SetPlayerCheckpoint(playerid, X, Y, Z, 6);
			}
		}
	}
	return 1;
}
La Comanda sa pun asta?
CautareJucator[playerid] = 1;

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.