09.04.2011, 17:53
pawn Код:
new callmechanic=999;
forward CP(playerid);
//--------------------------------------------------------------
if(strcmp(cmd, "/acceptcall", true) == 0)
{
if(callmechanic==999) return SendClientMessage(playerid, 0xFF0080FF, "No one need your help!");
SendClientMessage(playerid, 0xFF0080FF, "You accepted the call, you have 40seconds to be there.");
new iStr[128];
format(iStr, sizeof(iStr), "%s have accepted your call.");
SendClientMessage(playerid, 0xFF0080FF, iStr);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(callmechanic, X, Y, Z);
SetPlayerCheckpoint(playerid,X,Y,Z,5.0);
SetTimerEx("CP", 40000, 0, "i", playerid);
callmechanic=999;
return 1;
}
//
if(strcmp(cmd, "/callmechanic", true) == 0)
{
new iStr[128];
format(iStr, sizeof(iStr), "%s need a mechanic, use /acceptcall.");
SendClientMessageToAll(0xFF0080FF, iStr);
callmechanic = playerid;
return 1;
}
//--------------------------------------------------------------
public CP(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, 0xFF0080FF, "Time ended.");
return 1;
}