PHP код:
if(strcmp(cmd, "/duelh", true) == 0)
{
new duelid = GetPlayerDuelID(playerid);
if(duelid == 0)
{
new tmp1[TMP_SIZE];
new tmp2[TMP_SIZE];
new tmp3[TMP_SIZE];
new tmp4[TMP_SIZE];
new tmp5[TMP_SIZE];
new inv = INVALID_PLAYER_ID;
tmp1 = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
tmp3 = strtok(cmdtext, idx);
tmp4 = strtok(cmdtext, idx);
tmp5 = strtok(cmdtext, idx);
if(strlen(tmp5) == 0) inv = INVALID_PLAYER_ID;
else inv = strval(tmp5);
new errorid = CreateDuel(playerid,strval(tmp1),strval(tmp2),strval(tmp3),strval(tmp4),inv);
switch(errorid)
{
case -8: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" All duels ("#MAX_DUELS") already created. Wait please"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
case -2: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong location ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
case -3: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong primary weapon ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
case -4: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Wrong primary weapon ID"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
case -5: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Player is disconnected"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
case -6: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Player already on duel"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
case -7: SendClientMessage(playerid, COLOR_ERROR,""#ERROR" Impossible invite youself"),SendClientMessage(playerid, COLOR_USAGE,""#USAGE" "#USAGE_DUEL"");
}
}
else SendClientMessage(playerid, COLOR_ERROR,""#ERROR" You already created duel");
return 1;
}
/duelh [location ID] [primary weapon ID(/duelw)] [secondary weapon ID(/duelw)] [armour] (invite player ID (unnecessarily))"
THIS