Author Topic: I made new codes hope you like  (Read 3082 times)

0 Members and 1 Guest are viewing this topic.

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
I made new codes hope you like
« on: July 20, 2012, 04:57:14 am »
[pawn]else if ( strcmp( cmd, "!cop", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !strlen( tmp ) )
      {
         format( szMsg, sizeof( szMsg ), "%s:precisa de policia em %s", gPlayers[ playerid ], GetPlayerLocation( playerid ) );
         SendClientMessageToAll( BLUE, szMsg );
      }
      return 1;
   }
   else if ( strcmp( cmd, "!paramedic", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !strlen( tmp ) )
      {
         format( szMsg, sizeof( szMsg ), "%s:precisa de um paramedico em %s", gPlayers[ playerid ], GetPlayerLocation( playerid ) );
         SendClientMessageToAll( BLUE, szMsg );
      }
      return 1;
   }
    else if ( strcmp( cmd, "!tax", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !strlen( tmp ) )
      {
         format( szMsg, sizeof( szMsg ), "%s:precisa de um taxi em %s", gPlayers[ playerid ], GetPlayerLocation( playerid ) );
         SendClientMessageToAll( BLUE, szMsg );
      }
      return 1;
   }[/pawn]

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: I made new codes hope you like
« Reply #1 on: July 20, 2012, 06:40:50 am »
Well man, is a excelent beginner code, but our responsability is to teach you, so i will start with 1 of your example

[pawn]else if ( strcmp( cmd, "!cop", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !strlen( tmp ) )
      {
         format( szMsg, sizeof( szMsg ), "%s:precisa de policia em %s", gPlayers[ playerid ], GetPlayerLocation( playerid ) );
         SendClientMessageToAll( BLUE, szMsg );
      }[/pawn]
--------------------------------------------------------------
      tmp = strtok( cmdtext, idx );                 | This part isnt needed cuz it is saying that the player need to use this cmd
      if ( !strlen( tmp ) )                                 | !cop + player or another thing that you want like !cop jose
--------------------------------------------------------------

- All players will be able to use all of those cmds at the same time.
- No one will know what kind of job that player is.

YOU CAN SET DIFERENTS COLORS TO EACH TYPE OF JOB, LIKE YELLOW TO TAXI, BLUE TO COPS, THAT WILL REPRESENT EACH JOB.

Take care :D
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
Re: I made new codes hope you like
« Reply #2 on: July 20, 2012, 07:12:04 pm »
 :D thanks guy won and I'm still newbie thanks a lot thanks  ;)

Offline LisKa

  • Street Thug
  • *
  • Posts: 8
  • Pawn, Squirrel Scripter [Owner of Vice-Role Play]
    • View Profile
    • Vice-Role Play Server
Re: I made new codes hope you like
« Reply #3 on: July 20, 2012, 07:42:23 pm »
:D thanks guy won and I'm still newbie thanks a lot thanks  ;)
Remember, whenever you're making a command, be sure, it is clean and don't make it so complicated.