24.04.2011, 22:21
pawn Код:
#include <a_samp>
#include "../include/gl_common.inc"
#include <string>
#define FILTERSCRIPT
#define COLOR_WHITE 0xFFFFFFFF
new Bodyguard1, Float:X, Float:Y, Float:Z;
public OnGameModeInit()
{
Bodyguard1 = CreatePickup(1239, 23,1367.1448,-1290.2589,13.5469, 0);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Bodyguard1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: type /getjob to become a bodyguard.");
GetPlayerPos(playerid, X, Y, Z);
return 1;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp("/getjob", cmd, true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 1 ,X, Y, Z)){
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have just become a bodyguard!");
// do the job activation thing here
return 1;
}
}
return 0;
}