27.02.2010, 22:43
(
Последний раз редактировалось aircombat; 08.04.2011 в 09:54.
)
i have this /ticket command but problem is whenever i type /ticket id price it says : player is offline , so anyone can help??
________
Smartkeys
Код:
new giveplayerid, moneys; new giveplayer[MAX_PLAYER_NAME]; new sendername[MAX_PLAYER_NAME]; new TicketOffer[MAX_PLAYERS]; new TicketMoney[MAX_PLAYERS]; if(strcmp(cmd, "/ticket", true) == 0) { if(IsPlayerConnected(playerid)) { if(LSPLEADER) { SendClientMessage(playerid, red, " You are not a Cop!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, red, "USAGE: /ticket [playerid/PartOfName] [price]"); return 1; } giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, red, "USAGE: /ticket [playerid/PartOfName] [price]"); return 1; } moneys = strval(tmp); if(moneys < 1 || moneys > 301) { SendClientMessage(playerid, red, " Ticket Money can't be below 1 or higher then 300 !"); return 1; } if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if (ProxDetectorS(8.0, playerid, giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); 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, red, "USAGE: /ticket [playerid/PartOfName] [price]"); return 1; } format(string, sizeof(string), "* You gave %s a Ticket costing $%d, reason: %s", giveplayer, moneys, (result)); SendClientMessage(playerid, blue, string); format(string, sizeof(string), "* Officer %s has given you a Ticket costing $%d, reason: %s", sendername, moneys, (result)); SendClientMessage(giveplayerid, blue, string); SendClientMessage(giveplayerid, blue, "* Type /accept ticket, to accept it."); TicketOffer[giveplayerid] = playerid; TicketMoney[giveplayerid] = moneys; return 1; } else { SendClientMessage(playerid, red, " That player is not near you !"); return 1; } } } else { SendClientMessage(playerid, red, " That player is Offline !"); return 1; } } return 1; }
Smartkeys