PDA

View Full Version : Command Activated Pickups HELP?


ShawtyyMacJunior
12/07/2012, 11:53 PM
I need to learn how to make a pickup thats only activated if you give a command when on it. Could anyone give me an example?

zT KiNgKoNg
13/07/2012, 12:08 AM
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("//Command Here\\", cmdtext, true, 10) == 0) {
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s Has picked up <<Item>>", pname);
if(IsPlayerInRangeOfPoint(playerid, 1.0,Pickup Cords))
{
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
else SendClientMessage(playerid, 0x32E712FF, "Sorry your not in range of a pickup");
}
return 0;
}
Try this script

ShawtyyMacJunior
13/07/2012, 12:16 AM
Thanks very much. I also want it to only be available to one team. Meaning the pickup wont work for other team.

[MM]RoXoR[FS]
13/07/2012, 04:36 AM
if(IsPlayerInRangeOfPoint(playerid, 1.0,Pickup Cords) && gTeam[playerid] == TEAM_YOU_WANT)
{
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
else SendClientMessage(playerid, 0x32E712FF, "Sorry your not in range of a pickup | team");

Devilxz97
13/07/2012, 06:18 AM
if u have problems to make a pickups this is tutorial to make a Pickups : http://forum.sa-mp.com/showthread.php?t=327953 :)