14.03.2014, 01:24
I keep entering text but i get the sscanf message, what have i done wrong?
pawn Код:
CMD:textobject(playerid,params[])
{
#pragma unused params
if(!IsCnRAdmin(playerid)) return UnknownCMD(playerid);
new text[256];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /textobject (Text)");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerFacingAngle(playerid, A);
GetPlayerPos(playerid, X, Y, Z);
if(strlen(text) < 2) return SendClientMessage(playerid, COLOR_RED, "The Text Length Is Too Short.");
new myrobject = CreateObject(myzobject, X+3, Y, Z+1, 0.0, 0.0, A, 300.0);
SetObjectMaterialText(myrobject, text, 0, OBJECT_MATERIAL_SIZE_256x128,\
"Arial", 28, 0, COLOR_RED, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
new result[128];
format(result,sizeof(result), "The Object is been created with ID %d", myrobject);
SendClientMessage(playerid, COLOR_RED, result);
return 1;
}