it is spelled motto, but use sscanf
(traditional)
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/setmotto", true, 9))
{
new com[34], motto[24];
if (sscanf(cmdtext, "ss", com, motto)) SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /setmotto [motto]");
else
{
//3d text label stuff here, the motto they want is stored in the variable motto
}
return 1;
}
return 0;
}
(uncommon)
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
{
new com[128], params[128];
sscanf(cmdtext, "sz", com, params);
if (!strcmp(com, "/setmotto", true, 9))
{
new motto[24];
if (sscanf(params, "s", motto)) SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /setmotto [motto]");
else
{
//3d text label stuff here, the motto they want is stored in the variable motto
}
return 1;
}
return 0;
}
(dcmd)
pawn Код:
dcmd_setmotto(playerid, params[])
{
new motto[24];
if (sscanf(params, "s", motto)) SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /setmotto [motto]");
else
{
//3d text label stuff here, the motto they want is stored in the variable motto
}
return 1;
}
(zcmd)
pawn Код:
CMD:setmotto(playerid, params[])
{
new motto[24];
if (sscanf(params, "s", motto)) SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /setmotto [motto]"); //(this goes for all of the sscanf's) if you want the motto to be forced as 1 word only put a space after the s ("s ")
else
{
//3d text label stuff here, the motto they want is stored in the variable motto
}
return 1;
}