SA-MP Forums Archive
Can Anyone Help me script? - 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: Can Anyone Help me script? (/showthread.php?tid=356323)



Can Anyone Help me script? - ZBits - 03.07.2012

Hello i am scripting a RP server and i need help.

i need some cop faction commands which is /su(spect),/cuff,/r(adio),/jail [playerid] [time] no longer than 120 secs

and a cop rank like cadet,Swat and FBI

and then for a medic which is just /heal and /r


and the last thing i want is whenever a new player Join his team should be a civilian which is TEAM_CIV

please guys i really need help and i promise i will add whoever helps me in this script in my server credits

Thanks in Advance for help


AW: Can Anyone Help me script? - LeOsk - 03.07.2012

Why don't you think about it yourself? but ok i will help you with one:
/r
I am using ocmd:
Код:
ocmd:r (playerid,params[])
{
      new text[128];
      if(sscanf(params,"s",text))return SendClientMessage(playerid,COLOR_BLUE,"/r [text] - for radio chat");
      format(text,sizeof(text),"Radia: %s: %s",UserName(playerid),text); //UserName don't know your command
      for(new i=0; i<GetMaxPlayers(); i++)
      {
             if(IsPlayerConnected(i))
             {
                   if(isPlayerInFrakt(i,GetPVarInt(playerid,"faction")))
                   {
                         SendClientMessage(i,COLOR_WHITE,text);
                   }
             }
      }
      return 1;
}
NOTE: This is compatible with my script probably not with yours you have to edit it


Re: Can Anyone Help me script? - ZBits - 03.07.2012

....


AW: Can Anyone Help me script? - LeOsk - 03.07.2012

You should download something like ocmd and include it to your script:
zcmd
dcmd
ocmd
something like it

And about strcmp:
I found this with ******:
Код:
if(!strcmp(cmdtext, "/r", true))
{
        new string[128], Player[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Player, MAX_PLAYER_NAME);
        format(string, 128, "Radio: %s: %s", Player, cmdtext[2]);
        for(new i=0; i<MAX_PLAYERS; i++) 
        {
               if(IsPlayerConnected(i))
               {
                      if(gTeam[i] == TEAM_COP)
                      {
                            SendClientMessage(i,COLOR_LIGHBLUE,string);
                      }
               }
        }
        return 1;
}
I have never done it like this out maybe its working


Re: Can Anyone Help me script? - ZBits - 03.07.2012

i guess the code is right but when i do /r test it says SERVER: Unknown command,and when i do /r it says Radio[TwisT]:

can anyone help me?


AW: Can Anyone Help me script? - LeOsk - 03.07.2012

i would recommend you downloading one of the includes i send you: with them its much easier and better
and then you can use my first code its working fine


Re: Can Anyone Help me script? - ZBits - 04.07.2012

ok

can you tell me how to use dcmd?

as i said i am new in scripting


Re: Can Anyone Help me script? - ZBits - 04.07.2012

i need a small help

look a player did /duty and he goes in cop skin,and when he chooses in the dialog to go off duty i want his skin back to what it was before going on duty


can any one help me in this one?


Re: Can Anyone Help me script? - ZBits - 05.07.2012

Please i need Help!!!


Re: Can Anyone Help me script? - clarencecuzz - 06.07.2012

pawn Код:
if(gTeam[playerid] == TEAM_CIV)
{
SetPlayerSkin(playerid,274);
SendClientMessage(playerid,COLOR_PINK2,"Welcome to duty");
}
else return SendClientMessage(playerid, 0xFF0000AA, "You can't go on duty!"); //You can replace 0xFF0000AA with COLOR_RED etc.
Sorry, but this is all I can do to make your life easier, alot of people wouldn't be interested in creating a whole script for you. Try posting in the Script Request Thread.