04.10.2017, 04:50
PHP код:
YCMD:find(playerid, params[], help) {
if(help) {
SendClientMessage(playerid, X11_WHITE, "LEO command for finding a player");
return 1;
}
if(!IsAnLEO(playerid)) {
SendClientMessage(playerid, X11_TOMATO_2, "You aren't a cop!");
return 1;
}
if(!IsOnDuty(playerid)) {
SendClientMessage(playerid, X11_TOMATO_2, "You are not on duty!");
return 1;
}
if(!IsAtMDC(playerid)) {
SendClientMessage(playerid, X11_TOMATO_2, "You are not at a computer!");
return 1;
}
new playa;
/*new job = GetPVarInt(playerid, "Job");
if(job != EJobType_Mercenary) {
SendClientMessage(playerid, X11_TOMATO_2,"You must be a Mercenary");
return 1;
}*/
new time = canUseMercCommand(playerid);
new msg[128];
if(time != 0) {
format(msg, sizeof(msg), "You must wait %d seconds before continuing",time);
SendClientMessage(playerid, X11_TOMATO_2, msg);
return 1;
}
if(!sscanf(params, "k<playerLookup>", playa)) {
if(!IsPlayerConnectEx(playa)) {
SendClientMessage(playerid, X11_TOMATO_2, "User not found");
return 1;
}
if(GetPlayerState(playa) == PLAYER_STATE_SPECTATING || GetPlayerVirtualWorld(playa) != 0 || GetPlayerInterior(playa) != 0 || isTinFoiled(playa)) {
SendClientMessage(playerid, X11_TOMATO_2, "Could not locate player.");
return 1;
}
if(EAdminFlags:GetPVarInt(playa, "AdminFlags") & EAdminFlags_AdminManage) {
format(msg, sizeof(msg), "%s has used /find on you.",GetPlayerNameEx(playerid, ENameType_RPName_NoMask));
SendClientMessage(playa, X11_ORANGE, msg);
}
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playa, X, Y, Z);
SetPlayerCheckpoint(playerid, X, Y, Z, 3.0);
SetTimerEx("RemoveCheckpoint", getMercCheckpointTimeout(playerid), false, "d", playerid);
SetPVarInt(playerid, "LastMercCommand", gettime());
increaseJobPoints(playerid);
} else {
SendClientMessage(playerid, X11_WHITE, "USAGE: /find [playerid/name]");
}
return 1;
}
PHP код:
if(getFactionType(faction) != EFactionType_Hitman) {
SendClientMessage(playerid, X11_TOMATO_2, "You aren't a member of hitman!");
return 1;
}