Author Topic: cmd problem  (Read 2765 times)

0 Members and 1 Guest are viewing this topic.

Offline jimmy

  • Wiseguy
  • **
  • Posts: 94
    • View Profile
cmd problem
« on: January 15, 2012, 01:13:10 pm »
hey guys i am making a cmd !stopcar and !startcar see this what i did wrong in it

 else if ( strcmp( cmd, "!stopcar", true ) == 0 )
   {
         tmp = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
  else if(!strlen(tmp)) SendClientMessage(playerid,COLOR_GREEN, "USAGE: !stopcar [VehicleID]");
      else if(IsVehicleOwnedShared(strval(tmp),gPlayers[playerid]) == -1) SendClientMessage(playerid,COLOR_GREEN, "You do not have the keys for Stop that vehicle.");
      else {
      new vehicle = strval( tmp )
         SendClientMessage( playerid, RED, "You stopped Car" );
         GetVehicleStop( vehicleid );
      }
      return 1;
   }
    else if ( strcmp( cmd, "!startcar", true ) == 0 )
   {
         tmp = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
  else if(!strlen(tmp)) SendClientMessage(playerid,COLOR_GREEN, "USAGE: !startcar [VehicleID]");
      else if(IsVehicleOwnedShared(strval(tmp),gPlayers[playerid]) == -1) SendClientMessage(playerid,COLOR_GREEN, "You do not have the keys for start that vehicle.");
      else {
      new vehicle = strval( tmp )
         SendClientMessage( playerid, RED, "You started Car" );
         SetVehicleStart( vehicleid );
      }
      return 1;
   }
Storm City Owner

Stormcity.smfnew.com

Offline SaFeeR

  • Street Thug
  • *
  • Posts: 37
  • Pawno Scripter
    • View Profile
    • PaK-ServeR Website
Re: cmd problem
« Reply #1 on: January 16, 2012, 04:24:03 pm »
take this stopcar
Code: [Select]
else if ( strcmp( cmd, "!stopcar", true ) == 0 )
{
    tmp = strtok( cmdtext, idx );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: !stopcar [VehicleID]" );
else if ( !IsVehicleExist( strval( tmp ) ) ) SendClientMessage( playerid, COLOR_GREEN, "Error: Unknown Vehicle" );
else if ( !IsVehicleOwnedShared( strval( tmp ), gPlayers[ playerid ] ) ) SendClientMessage( playerid, COLOR_GREEN, "You Are Not Owner Of This Car." );
else
{
new vehicle = strval( tmp );
SendClientMessage( playerid, RED, "You Stopped Car....!!!" );
KillVehicleEngine( vehicle );
}
return 1;
}
If You Like My Scripting Like My Page


Offline Innocent Heart

  • Wiseguy
  • **
  • Posts: 51
  • Crime Investigation Department Owner
    • View Profile
    • Crime Investigaton Department
Re: cmd problem
« Reply #2 on: February 05, 2012, 03:05:37 pm »
Nice !
Conatact Information :
Facebook:-www.facebook.com/dashingjaff
Youtube:-www.youtube.com/NooranScripter

====>My Server Info  < ========
ServerName :- CID-Server
Server Clan :- [D.R] Dakriders
Server Forum :- www.CidServer.tk
Clan Forum :-www.Drgang.tk
=====> DarkRiders Group <=====

Pm Me If U want To be Pro In Scripting !
Those Who Banned my Ip and My Freind's Ip They Are Big Fuckers...!

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: cmd problem
« Reply #3 on: February 14, 2012, 11:16:39 am »
jimmy. Before you post a SCRIPT / SNIPPET.. ADD [pawn] SCRIPT HERE [/pawn]


YOU CAN SEE THE PAWN ICON IN THE MENU FOR POSTING.




And ....

Code: [Select]
         SetVehicleStart( vehicleid );
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players