12.07.2012, 23:53
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?
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;
}
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");