SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 08/03/2011, 04:03 PM   #951
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,038
Reputation: 125
Default Re: SA-MP 0.3c RC client/server (Now released)

Quote:
Originally Posted by k3nw00d_kri5ty View Post
I returned with 1;
You need return 0;
__________________

Peace...

Stigg is offline  
Old 08/03/2011, 04:04 PM   #952
k3nw00d_kri5ty
Big Clucker
 
Join Date: Nov 2009
Posts: 106
Reputation: 0
Default Re: SA-MP 0.3c RC client/server (Now released)

I returnd to 0 but didn't work
k3nw00d_kri5ty is offline  
Old 08/03/2011, 04:06 PM   #953
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,038
Reputation: 125
Default Re: SA-MP 0.3c RC client/server (Now released)

Quote:
Originally Posted by k3nw00d_kri5ty View Post
I returnd to 0 but didn't work
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(!strcmp(cmdtext, "/mycommand"))
     {
        //blah blah
        return 1;
     }
     return 0;//this is what i mean
}

Like that ?
In gamemode and filterscripts.
__________________

Peace...

Stigg is offline  
Old 08/03/2011, 04:07 PM   #954
k3nw00d_kri5ty
Big Clucker
 
Join Date: Nov 2009
Posts: 106
Reputation: 0
Default Re: SA-MP 0.3c RC client/server (Now released)

Yep.
k3nw00d_kri5ty is offline  
Old 08/03/2011, 04:09 PM   #955
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,038
Reputation: 125
Default Re: SA-MP 0.3c RC client/server (Now released)

Quote:
Originally Posted by k3nw00d_kri5ty View Post
Yep.
Cant see the problem then sozz.

Dont forget to look at what alpha500delta said about '\n' aswell.
__________________

Peace...

Stigg is offline  
Old 08/03/2011, 04:14 PM   #956
k3nw00d_kri5ty
Big Clucker
 
Join Date: Nov 2009
Posts: 106
Reputation: 0
Default Re: SA-MP 0.3c RC client/server (Now released)

Ok, another problem, when i want to teleport to somewhere and i'm a passenger in any vehicle i receive a big crash what its kicking me from the game.Or it's will teleport me with vehicle.
So i want that when i'm passenger, to remove me from vehicle and teleport me to the location WITHOUT CRASH !
k3nw00d_kri5ty is offline  
Old 08/03/2011, 04:16 PM   #957
k3nw00d_kri5ty
Big Clucker
 
Join Date: Nov 2009
Posts: 106
Reputation: 0
Default Re: SA-MP 0.3c RC client/server (Now released)

Quote:
Originally Posted by Stigg View Post
Cant see the problem then sozz.

Dont forget to look at what alpha500delta said about '\n' aswell.
I tried but nothing ...
The string is the blame.
k3nw00d_kri5ty is offline  
Old 08/03/2011, 04:33 PM   #958
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,038
Reputation: 125
Default Re: SA-MP 0.3c RC client/server (Now released)

Quote:
Originally Posted by [HLF]Southclaw View Post
@k3nw00d_kri5ty
There are a number of things to keep in mind:
'return 1;' at the end of the command if-statement
'return 0;' at the end of 'OnPlayerCommandText'
Make sure there isn't any invalid code such as accessing a cell in an array that doesn't exist

To find the line with the problem on:
In between each line put a message that sends to the player, if a piece of code doesn't work then the message after it will not send, therefore that is the line that stops the code:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/mycommand"))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "1");
        somecode();
        SendClientMessage(playerid, 0xFFFFFFFF, "2");
        somecode();
        SendClientMessage(playerid, 0xFFFFFFFF, "3");
        somecodeFunctionThatFails(); // this is the line that doesn't execute in my example
        SendClientMessage(playerid, 0xFFFFFFFF, "4"); // this will never be executed because the faulty line above
        return 1;
    }
}

On the player's screen it should read:
Code:
1
2
3
SERVER: Unknown Command
Now you know that whatever function is between the message 3 and 4 is the one that doesn't work, so look in your code at that line and you'll be one step closer to solving the problem

This is my method of debugging code, hope it helps
Nice explanation Southclaw, even i learn't something new there.
__________________

Peace...

Stigg is offline  
 

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
Client: Server not supported Shadow_Gengar Server Support 0 08/06/2010 08:12 PM
Can't even install client server! carcio Client Support 3 01/11/2009 09:21 PM
Client crashes often.. Does my server causes that? SiJ Client Support 8 20/07/2009 01:43 PM
Difference b/w Client and Server ? xmen General 7 12/11/2008 05:36 PM


All times are GMT. The time now is 05:45 AM.


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