SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 11/07/2013, 05:06 PM   #11
DJRebis
Big Clucker
 
DJRebis's Avatar
 
Join Date: Mar 2013
Location: Latvia
Posts: 104
Reputation: -2
Default Re: Cmd not working

Quote:
Originally Posted by mahdi499 View Post
pawn Code:
if (strcmp(cmdtext, "/route", true) == 0)
{
    if(IsPlayerInVehicle(playerid))
    {
        if(GetVehicleModel(vehicleid) == 537)
        {
        ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel");
        return 1;
        }
}
}

you understood if wrongfully you can't use If without () and a statment of Then after it.
Still 1 error:
Code:
error 017: undefined symbol "vehicleid"
__________________
[ND]Neon Drifters
[Map]Bus Station
[Map]Small Scientist base
[Map]City Island

DJRebis is offline   Reply With Quote
Old 11/07/2013, 05:23 PM   #12
Dragonsaurus
Huge Clucker
 
Dragonsaurus's Avatar
 
Join Date: Apr 2013
Location: Albania | Vlora
Posts: 496
Reputation: 52
Default Re: Cmd not working

Replace vehicleid with GetPlayerVehicleID(playerid)
pawn Code:
if (strcmp(cmdtext, "/route", true) == 0)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 537)
        {
        ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel");
        return 1;
        }
}
}
Dragonsaurus is offline   Reply With Quote
Old 11/07/2013, 05:25 PM   #13
DJRebis
Big Clucker
 
DJRebis's Avatar
 
Join Date: Mar 2013
Location: Latvia
Posts: 104
Reputation: -2
Default Re: Cmd not working

Quote:
Originally Posted by Dragonsaurus View Post
Replace vehicleid with GetPlayerVehicleID(playerid)
pawn Code:
if (strcmp(cmdtext, "/route", true) == 0)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 537)
        {
        ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel");
        return 1;
        }
}
}
Works now! Sooo tnx
__________________
[ND]Neon Drifters
[Map]Bus Station
[Map]Small Scientist base
[Map]City Island

DJRebis is offline   Reply With Quote
Old 11/07/2013, 05:34 PM   #14
DJRebis
Big Clucker
 
DJRebis's Avatar
 
Join Date: Mar 2013
Location: Latvia
Posts: 104
Reputation: -2
Default Re: Cmd not working

Ahh in server it isnt wokring!
SERER:Unknown Command!
Something wrong again!??
__________________
[ND]Neon Drifters
[Map]Bus Station
[Map]Small Scientist base
[Map]City Island

DJRebis is offline   Reply With Quote
Old 11/07/2013, 06:00 PM   #15
PrinceKumar
Huge Clucker
 
Join Date: Apr 2013
Posts: 432
Reputation: 6
Default Re: Cmd not working

Try This:-
pawn Code:
if (strcmp(cmdtext, "/route", true) == 0)
{

        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 537)
        {
        ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel");
       }
          return 1;
}
PrinceKumar is offline   Reply With Quote
Old 11/07/2013, 06:12 PM   #16
DJRebis
Big Clucker
 
DJRebis's Avatar
 
Join Date: Mar 2013
Location: Latvia
Posts: 104
Reputation: -2
Default Re: Cmd not working

Quote:
Originally Posted by PrinceKumar View Post
Try This:-
pawn Code:
if (strcmp(cmdtext, "/route", true) == 0)
{

        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 537)
        {
        ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel");
       }
          return 1;
}
In-Game don't show then there is no command but dialog dosent appier!!
__________________
[ND]Neon Drifters
[Map]Bus Station
[Map]Small Scientist base
[Map]City Island

DJRebis is offline   Reply With Quote
Old 11/07/2013, 06:17 PM   #17
Nostrum
Big Clucker
 
Join Date: Apr 2013
Posts: 59
Reputation: -2
Default Re: Cmd not working

Then you dont have the dialog coded!
Nostrum is offline   Reply With Quote
Old 11/07/2013, 06:23 PM   #18
DJRebis
Big Clucker
 
DJRebis's Avatar
 
Join Date: Mar 2013
Location: Latvia
Posts: 104
Reputation: -2
Default Re: Cmd not working

Quote:
Originally Posted by Nostrum View Post
Then you dont have the dialog coded!
What do you mean?
__________________
[ND]Neon Drifters
[Map]Bus Station
[Map]Small Scientist base
[Map]City Island

DJRebis is offline   Reply With Quote
Old 11/07/2013, 06:25 PM   #19
PrinceKumar
Huge Clucker
 
Join Date: Apr 2013
Posts: 432
Reputation: 6
Default Re: Cmd not working

you need to create dialog under
pawn Code:
public OnDialogResponse
PrinceKumar is offline   Reply With Quote
Old 11/07/2013, 06:28 PM   #20
DJRebis
Big Clucker
 
DJRebis's Avatar
 
Join Date: Mar 2013
Location: Latvia
Posts: 104
Reputation: -2
Default Re: Cmd not working

Quote:
Originally Posted by PrinceKumar View Post
you need to create dialog under
pawn Code:
public OnDialogResponse
I did it but not finished yet! +it was working before!And it shoudl appier even it it dont have fuctions on case!

Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(response)// They pressed the first button.
    {
    	switch(dialogid == 9999)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
			case 1:// Our dialog!
    	    {
           		switch(listitem)// Checking which listitem was selected
        		{
	        	    case 0://
	        	    {
	        	    
	        	    }
	        	    case 1:
	        	    {
	        	    
	        	    }
	        	    case 2:
	        	    {
	        	    
	        	    }
	        	    case 3:
	        	    {
	        	    
	        	    }

			     }

	        }
		}
    }
    return 1;
}
__________________
[ND]Neon Drifters
[Map]Bus Station
[Map]Small Scientist base
[Map]City Island

DJRebis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Working Vehicle storage system (100% working) eclipses Scripting Help 6 14/10/2012 10:13 PM
[HELP!] GTA SA:MP Is not working Mikedorst Client Support 4 19/09/2012 02:35 PM
Why it isn't working? TheChaoz Help Archive 4 31/12/2009 12:39 AM


All times are GMT. The time now is 09:22 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.