CallRemoteFunction sending PlayerText value
#1

I am currently working on a gamemode, and I prefer object oriented programming so I have been working on a SpawnSelection include file. Everything is working great, been using hooked methods to make everything plug and play, but I ran into a issue with trying to send a PlayerText value through CallRemoteFunction to OnPlayerClickPlayerTextDraw. not sure how to exactly send this value when there is not a format for it on https://sampwiki.blast.hk/wiki/CallRemoteFunction

I am just wondering if there is any way to do it.

pawn Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
//Not sure what to use where the ? mark is or if I need to just use the dirty method of not using CallRemoteFunction
    CallRemoteFunction("SS_OnPlayerClickPlayerTextDraw", "d?", playerid, playertextid);
    return 1;
}

#if defined _ALS_OnPlayerClickPlayerTextDra
    #undef OnPlayerClickPlayerTextDraw
#else
    #define _ALS_OnPlayerClickPlayerTextDra
#endif
#define OnPlayerClickPlayerTextDraw SS_OnPlayerClickPlayerTextDraw
forward SS_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
They are just integers, so "i" or "d", but because they have a special tag the compiler will complain as it doesn't think that is a valid use. We know it IS a valid use though, so you can override it like so:

pawn Код:
CallRemoteFunction("SS_OnPlayerClickPlayerTextDraw", "di", playerid, _:playertextid);
The "x:" syntax means "pretend the following symbol is this tag". The default tag for integers that don't have a tag specified (like your "playerid" variable) is "_".
Oho, So essentially _: tells it to ignore the tag and treat the integer value as a integer value. That's very useful. Much thanks for the explanation. This reminds me of casting object to other objects in Java.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)