Help with Spikes
#9

You bumped each 2 hours, I though the title "READ THIS BEFORE POSTING" in caps was big enough so people could read it.
But, whatever, it looks like reading posts is each time harder...
Let me help you...
Quote:

b) Do not bump
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 48 hours old, and it needs to have useful information about your problem.

https://sampforum.blast.hk/showthread.php?tid=45235.
Now, to your question...

pawn Код:
#include <a_samp>
    #include <SpikeStrip>

    strtok(const string[], &index)
    {
            new length = strlen(string);
            while ((index < length) && (string[index] <= ' '))
            {
                    index++;
            }

            new offset = index;
            new result[20];
            while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
            {
                    result[index - offset] = string[index];
                    index++;
            }
            result[index - offset] = EOS;
            return result;
    }
    //You can test it now xDD Ok :D
    public OnPlayerCommandText(playerid, cmdtext[])
    {
            new cmd[256];
            new idx;
            cmd = strtok(cmdtext, idx);

            if (strcmp(cmd,"/ms",true) == 0)
            {
                new name[MAX_PLAYER_NAME];
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
            GetPlayerPos(playerid, plocx, plocy, plocz);
            GetPlayerFacingAngle(playerid,ploca);
            GetPlayerName(playerid, name, sizeof(name));
            CreateStrip(name, plocx,plocy,plocz,ploca);
                return 1;
            }
            else if (strcmp(cmd,"/ds",true) == 0)
            {
                    DeleteClosestStrip(playerid);

                    for(new i = 0; i < sizeof(SpikeInfo); i++)
                    {
                        if(IsPlayerInRangeOfPoint(playerid, 2.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
                    {
                        new string[128];
                                    new pname[128];
                                    GetPlayerName(i, pname, sizeof(pname));
                                    format(string, sizeof(string), "You have removed the spike by: %s", pname);
                                    SendClientMessage(playerid, 0xFF0000FF, string);
                                    SpikeInfo[i][Name] = 0;
                            }
                    }
            }
            return 1;
    }
That should do it.
Reply


Messages In This Thread
[HELP] Spikes - by gunther12 - 06.05.2011, 23:39
Re: Help with Spikes - by gunther12 - 09.05.2011, 02:07
Re: Help with Spikes - by gunther12 - 12.05.2011, 00:46
Re: Help with Spikes - by gunther12 - 24.05.2011, 18:50
Re: Help with Spikes - by Admigo - 24.05.2011, 20:09
Re: Help with Spikes - by gunther12 - 24.05.2011, 21:06
Re : Re: Help with Spikes - by Naruto_Emilio - 24.05.2011, 21:37
Re: Re : Re: Help with Spikes - by gunther12 - 25.05.2011, 01:18
Re: Help with Spikes - by Deskoft - 25.05.2011, 02:18
Re: Help with Spikes - by PCheriyan007 - 25.05.2011, 23:04

Forum Jump:


Users browsing this thread: 1 Guest(s)