SA-MP Forums Archive
Command Ain't working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command Ain't working (/showthread.php?tid=350631)



Command Ain't working - Black Axe - 13.06.2012

Well.. I've made this CMD :

PHP код:
        if(strcmp(cmd, "/throwtrash", true) == 0)
        {
                new 
string[256];
                new 
name[MAX_PLAYER_NAME];
                
GetPlayerName(playerid, name, sizeof(name));
        for(new 
i = 0; i < sizeof(Trashmaster); i++)
                {
                        if(
PlayerInfo[playerid][HoldingObject] == 1)
                        {
                     new 
Float:tmx, Float:tmy, Float:tmz;
                         
GetVehiclePos(Trashmaster[i], tmx, tmy, tmz);
                         if(
IsPlayerInRangeOfPoint(playerid, 1.5, tmx, tmy, tmz))
                         {
                                
format(string, sizeof(string), " %s reaches into the dumpster and takes the trash bag", name);
                                
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                            
RemovePlayerAttachedObject(playerid, 0);
                                
PlayerInfo[playerid][HoldingObject] = 0;
                            }
                        }
                }
                return 
1;
        } 
But.. When i go near the Truck and Type it nothing happen.. It never works anywhere tho.


Re: Command Ain't working - PrawkC - 13.06.2012

Increase the radius for the IsPlayerInRangeOfPoint, put it at like 10 and then test it again.


Re: Command Ain't working - Black Axe - 13.06.2012

God.. You are right xD - Thanks very much.

Repped+