SA-MP Forums Archive
Help with Spikes - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with Spikes (/showthread.php?tid=253530)



[HELP] Spikes - gunther12 - 06.05.2011

Okay so I am working on this code where you put a spike and when you take it out it should say "You have removed the spike by:". But it won't show that, here is what I have.

The script:
http://pastebin.com/5gHb4MGe

The Include:
http://pastebin.com/g0DrqQBV


Re: Help with Spikes - gunther12 - 09.05.2011

BUMP


Re: Help with Spikes - gunther12 - 12.05.2011

BUMP to the top


Re: Help with Spikes - gunther12 - 24.05.2011

Bumpie Bump


Re: Help with Spikes - Admigo - 24.05.2011

Why you dont use someones spike script?


Re: Help with Spikes - gunther12 - 24.05.2011

Quote:
Originally Posted by admigo
Посмотреть сообщение
Why you dont use someones spike script?
No I am saying that when I take the spikes out it should say who put it like "You have removed the spike by: The person who set the spikes."


Re : Re: Help with Spikes - Naruto_Emilio - 24.05.2011

Quote:
Originally Posted by admigo
Посмотреть сообщение
Why you dont use someones spike script?
Because he want to have an original one


Re: Re : Re: Help with Spikes - gunther12 - 25.05.2011

Quote:
Originally Posted by Naruto_Emilio
Посмотреть сообщение
Because he want to have an original one
Can you help me getting that small part completed


Re: Help with Spikes - Deskoft - 25.05.2011

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.


Re: Help with Spikes - PCheriyan007 - 25.05.2011

Quote:
Originally Posted by Deskoft
Посмотреть сообщение
[I]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...

https://sampforum.blast.hk/showthread.php?tid=45235.
Hey genius, look at the date between his "BUMPITY BUMP" posts. That looks like about a week.