Для начала сделайте пикап на том месте, где игрок будет устраиваться и сделайте, чтобы он устраивался.
Далее следуйте моей инструкции:
1. В public OnPlayerCommandText(playerid, cmdtext[])
Code
if(strcmp(cmd, "/find", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 1)
{
SendClientMessage(playerid, COLOR_RED, "** Вы не работаете детективом!");
return 1;
}
if(PlayerOnMission[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " На мисси нельзя использовать эту команду !");
return 1;
}
if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
{
SendClientMessage(playerid, COLOR_RED, "** Жди 2 минуты!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ISPOLZUY, "*Используйте: /find [ид игрока]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_RED, "** Вы не можете искать самого себя!"); return 1; }
new points;
new level = PlayerInfo[playerid][pDetSkill];
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));
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 6);
FindTime[playerid] = 1;
FindTimePoints[playerid] = points;
PlayerInfo[playerid][pDetSkill] ++;
UsedFind[playerid] = 1;
if(PlayerInfo[playerid][pDetSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Твой скилл Детектива достиг 2 Уровня."); }
else if(PlayerInfo[playerid][pDetSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Твой скилл Детектива достиг 3 Уровня."); }
else if(PlayerInfo[playerid][pDetSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Твой скилл Детектива достиг 4 Уровня."); }
else if(PlayerInfo[playerid][pDetSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Твой скилл Детектива достиг 5 Уровня."); }
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Неправельный Ник/ID !");
}
}
return 1;
}
2. В enum pinfo
3. Ко всем new
Code
new PlayerOnMission[MAX_PLAYERS];
new UsedFind[MAX_PLAYERS];
new FindTimePoints[MAX_PLAYERS];
new FindTime[MAX_PLAYERS];