SA-MP Forums Archive
String problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: String problem (/showthread.php?tid=440993)



String problem - [..MonTaNa..] - 01.06.2013

Removed.


Re: String problem - Emmet_ - 01.06.2013

Can you show the whole code please?


Re: String problem - [..MonTaNa..] - 01.06.2013

Removed.


Re: String problem - Konstantinos - 01.06.2013

On the command, object ID should be printed correctly. On the callback, you create the variable
pawn Код:
new objectmodel;
and then you print that! It will take a value of zero. Why don't you use objectid instead?


Re: String problem - [..MonTaNa..] - 01.06.2013

Removed.


Re: String problem - Konstantinos - 01.06.2013

What I mean is that in OnPlayerEditObject callback, you create "objectmodel" (by default, it gets the value 0) and then you print that so the value will be 0.


Re: String problem - [..MonTaNa..] - 01.06.2013

Removed.


Re: String problem - Konstantinos - 01.06.2013

By itself, it will not.
pawn Код:
CMD:test(playerid, params[])
{
    new objectmodel, car;
    new string[128];
    format(string, sizeof string, "You Have Added Object ID %d On Vehicle ID %d.", objectmodel, car);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    return 1;
}
It will print "You Have Added Object ID 0 On Vehicle ID 0".

Like I said before, creating a variable without assigning a value to it, it will get the value 0 by default. You need to assign the value of the object that you've stored somewhere.


Re: String problem - Emmet_ - 01.06.2013

pawn Код:
format(string, sizeof(string), "You Have Attached Object ID %d In Array Slot %d Of Vehicle ID %d.", AttachingObjects[playerid], carslot, car);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);



Re: String problem - [..MonTaNa..] - 01.06.2013

Removed.