PDA

View Full Version : Why my Checkpoint wont work?


Stefand
12/11/2011, 08:14 AM
hi users,

Im trying to script a little but im not lucky xD

can someone help me with this

if(IsPlayerConnectedEx(GetPlayerID(text)))
{
new location[MAX_ZONE_NAME];
GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
format(string, sizeof(string), "911: %s has reported %s for %s (tracked from %s)", GetName(playerid), GetPlayerID(text), Player[playerid][ActiveCrimeReport], location);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnectedEx(i))
{
if(Groups[Player[i][Group]][CommandTypes] == 1 && Player[i][CopDuty] == 1)
{
SendClientMessage(i, RED, string);
}
}
}

i want if the Police or FMD get this call they get a checkpoint on there map where the crime or accident is.
can someone help me with this?

CyNiC
12/11/2011, 10:32 AM
I don't see none SetPlayerCheckpoint (http://wiki.sa-mp.com/wiki/Function:SetPlayerCheckpoint) there.

if(IsPlayerConnectedEx(GetPlayerID(text)))
{
new location[MAX_ZONE_NAME], pos[3];
GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
GetPlayerPos(playerid, pos[0], pos[1], pos[1]);
format(string, sizeof(string), "911: %s has reported %s for %s (tracked from %s)", GetName(playerid), GetPlayerID(text), Player[playerid][ActiveCrimeReport], location);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnectedEx(i))
{
if(Groups[Player[i][Group]][CommandTypes] == 1 && Player[i][CopDuty] == 1)
{
SendClientMessage(i, RED, string);
SetPlayerCheckpoint(i, pos[0], pos[1], pos[2], 5.0);
}
}
}

Stefand
12/11/2011, 12:11 PM
it gives 4 errors at my pawno