Jump to content
  • 0

Putin ajutor la comanda pls


angel

Question

Buna,am facut o comanda /estart,adica (event start).Dar nu reusesc sa fac sa pot scrie titlul,locatia,time,description.Cand dau /estart scriu titlul si prize...apare dar restu nu merge sa scri nimic.

if(strcmp(cmd, "/estart", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /estart [Title] [Prize] [Location] [Time] [Description]");

return 1;

}

new para1[20];

new title[24];

new location[60];

new description[64];

new offset = idx;

new time = strval(tmp);

para1 = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

title[idx - offset] = EOS;

location[idx - offset] = EOS;

description[idx - offset] = EOS;

if(PlayerInfo[playerid][pLevel] >= 10)

{

    if(IsPlayerConnected(para1))

    {

        if(para1 != INVALID_PLAYER_ID)

        {

            new prize = strval(tmp);

            new time = strval(tmp);

GetPlayerName(para1, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

format(str, 128, "Event: Title: %d, Prize: $%s,Location: %d, Time: %s", title, prize, location, time);

SendClientMessageToAll(COLOR_YELLOW, str);

format(str, 128, "Event: Organizer: %d, Description: %d, ",sendername ,description);

SendClientMessageToAll(COLOR_YELLOW, str);

return 1;

}

}

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, " ");

}

}

return 1;

}

Daca ti-am fost de ajutor +1 Respect!Multumesc

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

NexT." post="136309" timestamp="1363975266"]

Da, te ajuta Rock, el e cel mai bun de aici =]

Tie iti cade mana?

Si mersii, nu vazusem ca a facut up la topic.

Foloseste sscanf, este mult mai bine sa procesezi parametrii decat cu strtok.(si mai simplu)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.