Raider571 |
Дата: Понедельник, 06.06.2016, 21:40 | Сообщение # 1
|
Новичок
Сообщений: 3
Статус: Offline
|
Вообщем я сделал команду /takelic, но работает она только у инструкторов. У инструкторов ID 1. У МВД ID 9 у ФБР ID 12
Я хочу чтоб эта команда работала у всех 3 моих фракций. При вводе этой команды, даже в чате ничего не отображается. А у инструкторов работает и подсказка и сама команда.
Вот код CMD:
Код CMD:takelic(playerid, params[]) { if(pData[playerid][pFraction] != 1) return 1; if(pData[playerid][pFraction] != 1 && pData[playerid][pFraction] != 9 && pData[playerid][pFraction] != 12) return SendClientMessage(playerid,CWHITE,"Âàì íåäîñòóïíà äàííàÿ ôóíêöèÿ"); if(pData[playerid][pRank] < 5) return SendClientMessage(playerid,CWHITE,"Ýòà ôóíêöèÿ òîëüêî ðàáîòíèêîâ 5 ðàíãà è áîëüøå"); if(sscanf(params,"d",params[0])) return SendClientMessage(playerid, CYELLOW, "[Ïîäñêàçêà]:{"#cWHITE"} /takelic [id èãðîêà]"); if(!IsPlayerConnected(params[0]) || playerid == params[0]) return SendClientMessage(playerid,CGRAY,"Íåâåðíûé ID èãðîêà"); if(GetPlayerDistanceToPlayer(playerid,params[0]) > 3.0 || GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(params[0])) return SendClientMessage(playerid,CGRAY,"Âû äàëåêî äðóã îò äðóãà"); SetPVarInt(playerid,"TakeLicPlayerID",params[0]); ShowPlayerDialog(playerid,dTakeLic,DIALOG_STYLE_LIST,"{"#cORANGE"}Îòáîð ëèöåíçèè",""D"1. "W"Íàçåìíûå Ò/Ñ\n"D"2. "W"Âîçäóøíûå Ò/Ñ\n"D"3. "W"Âîäíûå Ò/Ñ\n"D"4. "W"Ëèöåíçèÿ íà îðóæèå","Çàáðàòü","Îòìåíà"); return true;
Код case dTakeLic: { if(!response) return 1; new apl = GetPVarInt(playerid,"TakeLicPlayerID"); if(GetPlayerDistanceToPlayer(playerid,apl) > 3.0 || GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(apl)) return SendClientMessage(playerid,CGRAY,"Âû äàëåêî äðóã îò äðóãà"); new msg1[50+MAX_PLAYER_NAME],msg2[60+MAX_PLAYER_NAME]; switch(listitem) { case 0: {//Çåìëÿ if(!pData[apl][pLicenses][LIC_DRIVING]) { SendClientMessage(playerid, CRED, "x {AC0000}[Îøèáêà] "W"Ó íàðóøèòåëÿ íåò âîäèòåëüñêèõ ïðàâ"); return true; } else { pData[apl][pLicenses][LIC_DRIVING] = 0; new query[128]; format(query,sizeof(query), "UPDATE `accounts` SET `licDrive` = '0' WHERE `id` = '%d'",pData[apl][pMysqlID]); sql_query(zConn, query); format(msg1,sizeof msg1,"Âû çàáðàëè ëèöåíçèþ íà íàçåìíûé òðàíñïîðò ó %s.",pData[apl][pNickname]); format(msg2,sizeof msg2,"Èíñòðóêòîð %s çàáðàë ó âàñ ëèöåíçèþ íà íàçåìíûé òðàíñïîðò.",pData[playerid][pNickname]); } } case 1: {//Âîçäóõ if(!pData[apl][pLicenses][LIC_FLY]) { SendClientMessage(playerid, CRED, "x {AC0000}[Îøèáêà] "W"Ó íàðóøèòåëÿ íåò ëèöåíçèé íà âîçäóøíûé òðàíñïîðò"); return true; } else { pData[apl][pLicenses][LIC_FLY] = 0; new query[128]; format(query,sizeof(query), "UPDATE `accounts` SET `licFly` = '0' WHERE `id` = '%d'",pData[apl][pMysqlID]); sql_query(zConn, query); format(msg1,sizeof msg1,"Âû çàáðàëè ëèöåíçèþ íà âîçäóøíûé òðàíñïîðò ó %s.",pData[apl][pNickname]); format(msg2,sizeof msg2,"Èíñòðóêòîð %s çàáðàë ó âàñ ëèöåíçèþ íà âîçäóøíûé òðàíñïîðò.",pData[playerid][pNickname]); } } case 2: {//Âîäà if(!pData[apl][pLicenses][LIC_BOAT]) { SendClientMessage(playerid, CRED, "x {AC0000}[Îøèáêà] "W"Ó íàðóøèòåëÿ íåò ëèöåíçèé íà âîäíûé òðàíñïîðò"); return true; } else { pData[apl][pLicenses][LIC_BOAT] = 0; new query[128]; format(query,sizeof(query), "UPDATE `accounts` SET `licBoat` = '0' WHERE `id` = '%d'",pData[apl][pMysqlID]); sql_query(zConn, query); format(msg1,sizeof msg1,"Âû çàáðàëè ëèöåíçèþ íà âîäíûé òðàíñïîðò ó %s.",pData[apl][pNickname]); format(msg2,sizeof msg2,"Èíñòðóêòîð %s çàáðàë ó âàñ ëèöåíçèþ íà âîäíûé òðàíñïîðò.",pData[playerid][pNickname]); } } case 3: {//Îðóæèå if(!pData[apl][pLicenses][LIC_WEAP]) { SendClientMessage(playerid, CRED, "x {AC0000}[Îøèáêà] "W"Ó íàðóøèòåëÿ íåò ëèöåíçèé íà îðóæèå"); return true; } else { pData[apl][pLicenses][LIC_WEAP] = 0; new query[128]; format(query,sizeof(query), "UPDATE `accounts` SET `licWeap` = '0' WHERE `id` = '%d'",pData[apl][pMysqlID]); sql_query(zConn, query); format(msg1,sizeof msg1,"Âû çàáðàëè ëèöåíçèþ íà îðóæèå ó %s.",pData[apl][pNickname]); format(msg2,sizeof msg2,"Èíñòðóêòîð %s çàáðàë ó Âàñ ëèöåíçèþ íà îðóæèå",pData[playerid][pNickname]); } } } SendClientMessage(playerid,COLOR_GREEN,msg1); SendClientMessage(apl,COLOR_RED,msg2); UpdatePlayerData(apl,"licenses",pData[apl][pLicenses]); return true; }
Raider
|
|
|
|
=) |
Дата: Понедельник, 06.06.2016, 23:00 | Сообщение # 2
|
Боец
Сообщений: 271
Статус: Offline
|
- if(pData[playerid][pFraction] != 1) return 1; это удали.
|
|
|
|