SA-MP Forums Archive
/sos message? - 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: /sos message? (/showthread.php?tid=125624)



/sos message? - Torran - 04.02.2010

Im trying to make a sos
So someone types /sos [location]
and it sends a message to medicals, Showing there name, And what location they put down,
I know the sending to medicals, Its just to read what they put for location i wanna know,
Im using dcmd,


Re: /sos message? - Torran - 04.02.2010

Anyone?


Re: /sos message? - mansonh - 04.02.2010

Nice illegal bump.

Just read in the string from the user input in dcmd command.
Then use that in the output to the medics.

If that doesn't make sense then post your dcmd and i will take a look.


Re: /sos message? - Torran - 04.02.2010

I havent got one, Im making it, But this is the main bit, So nothing of the command exists just yet


Re: /sos message? - mansonh - 04.02.2010

Ok, well give it a try making it, and see how it goes (you can't ask people to code everything for you, unless you go to script request thread), then if you run into problems post.

Basically you can do a dcmd
dmcd_sos

then use sscanf to check for location
then send the message to all medics


Re: /sos message? - Torran - 05.02.2010

1. This topic isent for the whole code, Just the bit to check for location
2. I wouldnt be asking if i knew how to use sscanf
3. I have no clue what to do when using sscanf


Re: /sos message? - ettans - 05.02.2010

pawn Код:
dcmd_sos(playerid, params[])
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      if(GetPlayerTeam(i) == 0) // Change to the team ID of medic
      {
        format(string,sizeof(string),"[SOS] %s needs help at %s",PlayerName(playerid),params[6]);
        SendClientMessage(i,COLOR_RED,string);
        return 1;
      }
    }
  }
}
Something like this? Or do you want it to automatically output the players location if '/sos' is typed?


Re: /sos message? - Torran - 05.02.2010

Its so they type

/sos [location]

So if they typed jsuhufghsudfs
It wud send a message to medic saying: jsuhufghsudfs, xd, will tht code do tht


Re: /sos message? - Doppeyy - 05.02.2010

Quote:
Originally Posted by Torran
Its so they type

/sos [location]

So if they typed jsuhufghsudfs
It wud send a message to medic saying: jsuhufghsudfs, xd, will tht code do tht
Go and try it ? we dont have to test things for you.

[Doppeyy


Re: /sos message? - ettans - 05.02.2010

Yes, that's how that code works.