Help needed for SetPlayerCheckpoint
#1

Quote:

if(strcmp("/panic", cmd) == 0) {
new PolicePath[48], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(PolicePath, sizeof(PolicePath), "\\Police\\%s.ini", pname);
if(dini_Exists(PolicePath)) {
if(PoliceDuty[playerid] == 1) {
new message[128], rank[50];
if(strcmp("1", dini_Get(PolicePath, "Rank")) == 0) rank = "Trainee U.S Marshal";
if(strcmp("2", dini_Get(PolicePath, "Rank")) == 0) rank = "Detention Enforcement Officer";
if(strcmp("3", dini_Get(PolicePath, "Rank")) == 0) rank = "Deputy U.S Marshal";
if(strcmp("4", dini_Get(PolicePath, "Rank")) == 0) rank = "Sr. U.S Marshal";
if(strcmp("5", dini_Get(PolicePath, "Rank")) == 0) rank = "Chief U.S Marshal";
new player1, current_zone, current_area;
player1 = playerid;
current_zone = player_zone[player1]; current_area = player_zarea[player1];
if(current_zone != -1 && current_area != -1) {
format(message, sizeof(message), "USMS CODE ZERO - %s %s(%03d) has actitivated their panic alarm. Check your minimap.", rank, pname, dini_Int(PolicePath, "Badge"), zones[current_zone][zone_name], zarea[current_area][zarea_name]);
SendPoliceMessage(COLOR_RED, message);
for(new i; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(PoliceDuty[i] == 1) {
PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
SetTimer("PoliceToneStage1", 500, false);
GameTextForPlayer(i, "~r~ DROP WHAT YOU'RE DOING AND RESPOND.", 3000, 0);
}
}
}
}
}
else if(PoliceDuty[playerid] == 0) {
SendClientMessage(playerid, COLOR_RED, "ERROR: You must be on duty in order to use this command.");
}
}
else if(!dini_Exists(PolicePath)) {
SendClientMessage(playerid, COLOR_RED, "ERROR: You do not have permission to use this command.");
}
return 1;
}

I'm not sure how to make it add a checkpoint to the player and so only the faction can see it. Basically the checkpoint would show up on the map behind them when they type /panic and follow them. Other faction members would see the checkpoint on the map and race to help him. I'm new to scripting, sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)