24.11.2012, 22:56
Ok so I am relitively new to scripting and have never made a textdraw. I was wondering if someone could show me how to make the following code (which is currently a client message) into a textdraw located under the chat messages.
Please & Thanks: jakejohnsonusa
I usually Rep. people who are able to help me
Here is what I would like made into a TextDraw:
Here is the command part:
Here is the Timer part of the command:
Please & Thanks: jakejohnsonusa
I usually Rep. people who are able to help me
Here is what I would like made into a TextDraw:
Here is the command part:
pawn Код:
new DetectorTimer[MAX_PLAYERS];
new DetectorOn[MAX_PLAYERS]=1;
if (strcmp("/detectoron", cmdtext, true, 11) == 0)
{
if(PlayerInfo[playerid][pDetector])
{
if(IsPlayerInAnyVehicle(playerid))
{
if(DetectorTimer[playerid] != -1) KillTimer(DetectorTimer[playerid]);//
DetectorTimer[playerid] = SetTimerEx("RunDetector", 2000, true, "i", playerid);
SendClientMessage(playerid,-1,"Detector On");
DetectorOn[playerid]=1;
return 1;
}
SendClientMessage(playerid, COLOR_GREY, "** You aren't in a vehicle!");
return 1;
}
SendClientMessage(playerid, COLOR_GREY, "** You don't have a Radar Detector!");
return 1;
}
if (strcmp("/detectoroff", cmdtext, true, 12) == 0)
{
if(PlayerInfo[playerid][pDetector])
{
if(IsPlayerInAnyVehicle(playerid))
{
if(DetectorOn[playerid]==0)return SendClientMessage(playerid,-1,"Detector Already OFF");
SendClientMessage(playerid,-1,"Detector OFF");
KillTimer(DetectorTimer[playerid]);
DetectorOn[playerid]=0;
return 1;
}
SendClientMessage(playerid, COLOR_GREY, "** You aren't in a vehicle!");
return 1;
}
SendClientMessage(playerid, COLOR_GREY, "** You don't have a Radar Detector!");
return 1;
}
pawn Код:
public RunDetector(playerid)
{
new counter = 0, string[128];
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 30.0, x, y, z) && i != playerid && IsPlayerConnected(i) && IsACop(i))
{
format(string, sizeof(string), "Law Enforcment Detected", Nick(i), i);
SendClientMessage(playerid,0xFF0000FF,string);
counter++;
}
}
if(counter == 0) return SendClientMessage(playerid, 0x1CFF1CFF, "No Law Enforcment Detected.");
return 1;
}