Please help me!?
#1

Hello, i was wondering how i could join 2 different scripts together.

For example:

OnPlayerStateChange(blahdy blahdy blah)
{



Nos script


Private vehicle script

return 1;
}

Please help me, its desperately needed.
Reply
#2

Here's how

pawn Код:
// NOS script
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    stuff_from_nos_script;
    return 1;
}

//       +

//private vehicle script
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    stuff_from_prv_veh_script;
    return 1;
}
Equals:

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    stuff_from_nos_script;
    stuff_from_prv_veh_script;
    return 1;
}
Voilа
Reply
#3

sorry mate but u cant put two of the same thing in a script, u cant put OnPlayerStateChange twice?
Reply
#4

error 021: symbol already defined: "OnPlayerStateChange"
Reply
#5

You can't put OnPlayerStateChange twice, no.
You merge it's contents together.
Reply
#6

can u give me an example please?
Reply
#7

I just did.
Reply
#8

not a clear example
Reply
#9

Both scripts contains stuff inside OnPlayerStateChange (example)
And if you want both in same script, you just easily put the contents of BOTH scripts into the OnPlayerStateChange callback in the script you want both in.
Reply
#10

yeh but how, it is not working for ME!?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)