Код:
if(strcmp(cmd, "/opis", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Nie zalogowałeś się !");
return 1;
}
if(opis[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "Posiadasz już opis pierw usun swуj opis komendą /opisusun");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "UŻYJ: /opis [tekst] /opisusun");
return 1;
}
format(string, sizeof(string), "%s %s", sendername, result);
Opis[playerid] = Create3DTextLabel(string, COLOR_PURPLE, 0.0, 0.0, 0.0, 10.0, 0, 0);
Attach3DTextLabelToPlayer(Opis[playerid], playerid, 0.0, 0.0, -0.5);//nakłada opis,i ustawia wysokość
Update3DTextLabelText(Opis[playerid], COLOR_FADE1, string);//nakłada opis graczowi
format(string, sizeof(string), "Twoj Opis: %s", (result));
opis[playerid] +=1;
SendClientMessage(playerid, COLOR_GRAD2,string);
printf("%s", string);
}
else
{
Delete3DTextLabel(Opis[playerid]);
}
return 1;
}
if(strcmp(cmd, "/opisusun", true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(opis[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Nie posiadasz opisu więc nie możesz go usunąć");
return 1;
}
Delete3DTextLabel(Opis[playerid]);
opis[playerid] -=1;
SendClientMessage(playerid, COLOR_GRAD2, "Opis został poprawnie usunięty");
}
return 1;
}
Код:
format(string, sizeof(string), "%s %s", sendername, result);
pawn Код:
format(string, sizeof(string), "%s \n %s", sendername, result);