Author Topic: Cmd Problem  (Read 2707 times)

0 Members and 1 Guest are viewing this topic.

Offline YoMan

  • Street Thug
  • *
  • Posts: 17
    • View Profile
Cmd Problem
« on: March 03, 2012, 02:39:34 pm »
guys i made this cmd to !gotoloc with vehicle but its not working

Code: [Select]
    else if ( strcmp( cmd, "!gotoloc", true ) == 0 )
{
new vehicle;
  tmp = strtok( cmdtext, idx );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
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: !gotoloc [Name]" );
else
{
    new splitx[ 3 ][ 128 ], szMsg[ 128 ];
    if ( !IsLocationExist( tmp ) )
{
    format( szMsg, sizeof( szMsg ), "Location:[ %s ] does not exist.", tmp );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
return 1;
    }
    split( dini_Get( "/SavedLocations/Locations.ini", tmp ), splitx, ' ' );
   
    SetPlayerPos( playerid, floatstr( splitx[ 0 ] ), floatstr( splitx[ 1 ] ), floatstr( splitx[ 2 ] ), 0, 0 );
    SetVehiclePos( vehicle, floatstr( splitx[ 0 ] ), floatstr( splitx[ 1 ] ), floatstr( splitx[ 2 ] ), 0, 0 );
    format( szMsg, sizeof( szMsg ), "Teleporting to location:[ %s ]", tmp );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
return 1;
    }

help me

Offline SaFeeR

  • Street Thug
  • *
  • Posts: 37
  • Pawno Scripter
    • View Profile
    • PaK-ServeR Website
Re: Cmd Problem
« Reply #1 on: March 04, 2012, 02:45:07 am »
Code: [Select]
    else if ( strcmp( cmd, "!gotoloc", true ) == 0 )
{
new vehicle;
  tmp = strtok( cmdtext, idx );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
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: !gotoloc [Name]" );
else
{
    new splitx[ 3 ][ 128 ], szMsg[ 128 ];
    if ( !IsLocationExist( tmp ) )
{
    format( szMsg, sizeof( szMsg ), "Location:[ %s ] does not exist.", tmp );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
else
{
    split( dini_Get( "/SavedLocations/Locations.ini", tmp ), splitx, ' ' );
   
    SetPlayerPos( playerid, floatstr( splitx[ 0 ] ), floatstr( splitx[ 1 ] ), floatstr( splitx[ 2 ] ), 0, 0 );
    SetVehiclePos( vehicle, floatstr( splitx[ 0 ] ), floatstr( splitx[ 1 ] ), floatstr( splitx[ 2 ] ), 0, 0 );
    format( szMsg, sizeof( szMsg ), "Teleporting to location:[ %s ]", tmp );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
return 1;
    }

try this
not tested
leave a comment if its work or not
If You Like My Scripting Like My Page


Offline power

  • Street Thug
  • *
  • Posts: 10
  • Scripts Hoster and Scripter & Glitcher
    • View Profile
Re: Cmd Problem
« Reply #2 on: March 08, 2012, 09:58:29 pm »
I WANT HELP IN SCRIPTING I WANNA ADD KILLP CMD AND SLAP TELL ME PLEASE
IAM NEW SCRIPTER AND HAVE LOTS OF IDEAS TO MAKE PWN GREAT SCRIPTS THAN ANY NOT
PWN HELP ME SCRIPTERS PLEASE

Offline YoMan

  • Street Thug
  • *
  • Posts: 17
    • View Profile
Re: Cmd Problem
« Reply #3 on: March 09, 2012, 12:23:38 am »
u have to make a topic then i will give u