Mivčo 90 Odesláno: 10. Leden, 2015 Share Odesláno: 10. Leden, 2015 Zdravím.. ako by som dal z CMD do ZCMD tento príkaz n aby som tam neal tmp cmd a tak...? if(strcmp(cmd, "/tempban", true) == 0) //Credits to LuxAdmin { new name[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new giveplayerid; if(Account[playerid][Level] < 5) return SendClientMessage(playerid,Red,"ERROR: You are not a high enough level to use this command"); tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_ERROR, "{6EF83C}Usage: {FFFFFF}/tempban [PlayerID] [Day(s)] [Reason]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "{6EF83C}Usage: {FFFFFF}/tempban [PlayerID] [Day(s)] [Reason]"); return 1; } new days = strval(tmp); if(!IsNumeric(tmp)) return SendClientMessage(playerid, Red, "ERROR: Invalid Day! Only Numbers!"); if(strval(tmp) <= 0 || strval(tmp) > 1000) return SendClientMessage(playerid, Red, "ERROR: Invalid Day! (1-1000)"); new reason[128]; reason = strtok2(cmdtext,idx); if (!strlen(reason)) return SendClientMessage(playerid, Red, "ERROR: Reason not Specified!"); if (strlen(reason) <= 0 || strlen(reason) > 100) return SendClientMessage(playerid, Red, "ERROR: Invalid Reason length!"); new ip[15]; GetPlayerIp(giveplayerid,ip,15); GetPlayerName(playerid, name, sizeof name); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); new File:tempban = fopen("ZeroAdmin/Logs/TempBans.ban", io_append); if (tempban) { new year,month,day; getdate(year, month, day); day += days; if (IsMonth31(month)) { if (day > 31) { month += 1; if (month > 12) { year += 1; while(day > 31) day -= 31; } else while(day > 31) day -= 31; } } else if (!IsMonth31(month)) { if (day > 30) { month += 1; if (month > 12) { year += 1; while(day > 30) day -= 30; } else while(day > 30) day -= 30; } } else if (!IsMonth31(month) && IsMonth29(year) && month == 2) { if (day > 29) { month += 1; if (month > 12) { year += 1; while(day > 29) day -= 29; } else while(day > 29) day -= 29; } } else if (!IsMonth31(month) && !IsMonth29(year) && month == 2) { if (day > 28) { month += 1; if (month > 12) { year += 1; while(day > 28) day -= 28; } else while(day > 28) day -= 28; } } format(string, sizeof string, "%d|%d|%d|%s\n", day, month, year, ip); fwrite(tempban, string); fclose(tempban); } format(string,128,"Administrator %s Temporarily Banned %s for %d Day(s) Reason: %s",name,giveplayer,days,reason); SendClientMessageToAll(Red,string); Kick(giveplayerid); format(string, sizeof string, "Admin %s Temporarily Banned %s for %d Day(s) Reason: %s",name,giveplayer,days,reason); SaveLogs("TempBansLog",string); } else { SendClientMessage(playerid,Red,"ERROR: Player is not connected"); } } return 0; } Link to comment Share on other sites More sharing options...
0 VirginBuster 0 Odesláno: 10. Leden, 2015 Share Odesláno: 10. Leden, 2015 COMMAND:mycommand(playerid, params[]) { //http://wiki.sa-mp.com/wiki/Sscanf_code //http://wiki.sa-mp.com/wiki/Fast_Commands hledej sscanf return 1; } Není to zase tak těžký. Trošičku se zamysli a pohledej si, vyzkoušej si /*=================================================================================================================== Zamysli se...já ti nechci předělávat celej příkaz, i když to je na chvíli. Nemám v pc Pawno. Předpokládám že umíš udělat ZCMD příkaz. Nahoru hodíš stock, uděláš příkaz, a do něj si celej příkaz uprav aby jel přes sscanf. Přes něj můžeš udělat víc parametrů. Máš tam tabulku písmen na ten parametr který určuje o jaký typ parametru se jedná. Pro jména/id používej u, čísla i, text s.... ===================================================================================================================*/ Link to comment Share on other sites More sharing options...
0 Mivčo 90 Odesláno: 10. Leden, 2015 Author Share Odesláno: 10. Leden, 2015 z ZCMD viem pracovat ale ja tam nechem napriklad toto => tmp = strtok(cmdtext,idx); a tak dalej Link to comment Share on other sites More sharing options...
0 VirginBuster 0 Odesláno: 10. Leden, 2015 Share Odesláno: 10. Leden, 2015 Promiň, ale předělávat to nebudu...Pokud se zamyslíš a pohledáš si na wiki apod, tak si to sám uděláš. Pokud ne tak si počkej a někdo to za tebe udělá nebo ti to sem nakopíruje Link to comment Share on other sites More sharing options...
0 Noob14_ 7 Odesláno: 10. Leden, 2015 Share Odesláno: 10. Leden, 2015 CMD:tempban(playerid,params[]) { new name[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new giveplayerid; if(Account[playerid][Level] < 5) return SendClientMessage(playerid,Red,"ERROR: You are not a high enough level to use this command"); tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_ERROR, "{6EF83C}Usage: {FFFFFF}/tempban [PlayerID] [Day(s)] [Reason]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "{6EF83C}Usage: {FFFFFF}/tempban [PlayerID] [Day(s)] [Reason]"); return 1; } new days = strval(tmp); if(!IsNumeric(tmp)) return SendClientMessage(playerid, Red, "ERROR: Invalid Day! Only Numbers!"); if(strval(tmp) <= 0 || strval(tmp) > 1000) return SendClientMessage(playerid, Red, "ERROR: Invalid Day! (1-1000)"); new reason[128]; reason = strtok2(cmdtext,idx); if (!strlen(reason)) return SendClientMessage(playerid, Red, "ERROR: Reason not Specified!"); if (strlen(reason) <= 0 || strlen(reason) > 100) return SendClientMessage(playerid, Red, "ERROR: Invalid Reason length!"); new ip[15]; GetPlayerIp(giveplayerid,ip,15); GetPlayerName(playerid, name, sizeof name); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); new File:tempban = fopen("ZeroAdmin/Logs/TempBans.ban", io_append); if (tempban) { new year,month,day; getdate(year, month, day); day += days; if (IsMonth31(month)) { if (day > 31) { month += 1; if (month > 12) { year += 1; while(day > 31) day -= 31; } else while(day > 31) day -= 31; } } else if (!IsMonth31(month)) { if (day > 30) { month += 1; if (month > 12) { year += 1; while(day > 30) day -= 30; } else while(day > 30) day -= 30; } } else if (!IsMonth31(month) && IsMonth29(year) && month == 2) { if (day > 29) { month += 1; if (month > 12) { year += 1; while(day > 29) day -= 29; } else while(day > 29) day -= 29; } } else if (!IsMonth31(month) && !IsMonth29(year) && month == 2) { if (day > 28) { month += 1; if (month > 12) { year += 1; while(day > 28) day -= 28; } else while(day > 28) day -= 28; } } format(string, sizeof string, "%d|%d|%d|%s\n", day, month, year, ip); fwrite(tempban, string); fclose(tempban); } format(string,128,"Administrator %s Temporarily Banned %s for %d Day(s) Reason: %s",name,giveplayer,days,reason); SendClientMessageToAll(Red,string); Kick(giveplayerid); format(string, sizeof string, "Admin %s Temporarily Banned %s for %d Day(s) Reason: %s",name,giveplayer,days,reason); SaveLogs("TempBansLog",string); } else { SendClientMessage(playerid,Red,"ERROR: Player is not connected"); } } Link to comment Share on other sites More sharing options...
0 Mivčo 90 Odesláno: 10. Leden, 2015 Author Share Odesláno: 10. Leden, 2015 CMD:tempban(playerid,params[]) { new name[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new giveplayerid; if(Account[playerid][Level] < 5) return SendClientMessage(playerid,Red,"ERROR: You are not a high enough level to use this command"); tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_ERROR, "{6EF83C}Usage: {FFFFFF}/tempban [PlayerID] [Day(s)] [Reason]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "{6EF83C}Usage: {FFFFFF}/tempban [PlayerID] [Day(s)] [Reason]"); return 1; } new days = strval(tmp); if(!IsNumeric(tmp)) return SendClientMessage(playerid, Red, "ERROR: Invalid Day! Only Numbers!"); if(strval(tmp) <= 0 || strval(tmp) > 1000) return SendClientMessage(playerid, Red, "ERROR: Invalid Day! (1-1000)"); new reason[128]; reason = strtok2(cmdtext,idx); if (!strlen(reason)) return SendClientMessage(playerid, Red, "ERROR: Reason not Specified!"); if (strlen(reason) <= 0 || strlen(reason) > 100) return SendClientMessage(playerid, Red, "ERROR: Invalid Reason length!"); new ip[15]; GetPlayerIp(giveplayerid,ip,15); GetPlayerName(playerid, name, sizeof name); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); new File:tempban = fopen("ZeroAdmin/Logs/TempBans.ban", io_append); if (tempban) { new year,month,day; getdate(year, month, day); day += days; if (IsMonth31(month)) { if (day > 31) { month += 1; if (month > 12) { year += 1; while(day > 31) day -= 31; } else while(day > 31) day -= 31; } } else if (!IsMonth31(month)) { if (day > 30) { month += 1; if (month > 12) { year += 1; while(day > 30) day -= 30; } else while(day > 30) day -= 30; } } else if (!IsMonth31(month) && IsMonth29(year) && month == 2) { if (day > 29) { month += 1; if (month > 12) { year += 1; while(day > 29) day -= 29; } else while(day > 29) day -= 29; } } else if (!IsMonth31(month) && !IsMonth29(year) && month == 2) { if (day > 28) { month += 1; if (month > 12) { year += 1; while(day > 28) day -= 28; } else while(day > 28) day -= 28; } } format(string, sizeof string, "%d|%d|%d|%s\n", day, month, year, ip); fwrite(tempban, string); fclose(tempban); } format(string,128,"Administrator %s Temporarily Banned %s for %d Day(s) Reason: %s",name,giveplayer,days,reason); SendClientMessageToAll(Red,string); Kick(giveplayerid); format(string, sizeof string, "Admin %s Temporarily Banned %s for %d Day(s) Reason: %s",name,giveplayer,days,reason); SaveLogs("TempBansLog",string); } else { SendClientMessage(playerid,Red,"ERROR: Player is not connected"); } } to mám errory.... error 017: undefined symbol "tmp"error 017: undefined symbol "cmdtext"error 017: undefined symbol "tmp"error 017: undefined symbol "tmp" error 017: undefined symbol "tmp"error 017: undefined symbol "cmdtext"error 017: undefined symbol "tmp"error 017: undefined symbol "tmp"error 017: undefined symbol "tmp"error 017: undefined symbol "tmp"error 017: undefined symbol "cmdtext"error 017: undefined symbol "string"error 017: undefined symbol "string"error 017: undefined symbol "string"error 017: undefined symbol "string"error 017: undefined symbol "string"error 017: undefined symbol "string"error 017: undefined symbol "string"error 017: undefined symbol "string"warning 209: function "@_yCtempban" should return a valueerror 010: invalid function or declaration Link to comment Share on other sites More sharing options...
0 VirginBuster 0 Odesláno: 10. Leden, 2015 Share Odesláno: 10. Leden, 2015 (upraveno) Beru to zpět, nic se učit nechce Edited 10. Leden, 2015 by VirginBuster Link to comment Share on other sites More sharing options...
0 Mivčo 90 Odesláno: 10. Leden, 2015 Author Share Odesláno: 10. Leden, 2015 ja chcem ale toto mi robí problém Link to comment Share on other sites More sharing options...
0 VolfikCZ 33 Odesláno: 10. Leden, 2015 Share Odesláno: 10. Leden, 2015 Citace: Noob14_ CMD:tempban(playerid,params[]) { new name[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new giveplayerid; if(Account[playerid][Level] < 5) return SendClientMessage(playerid,Red,"ERROR: You are not a high enough level to use this command"); tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid,COLOR_ERROR, "{6EF83C}Usage: {FFFFFF}/tempban [PlayerID] [Day(s)] [Reason]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "{6EF83C}Usage: {FFFFFF}/tempban [PlayerID] [Day(s)] [Reason]"); return 1; } new days = strval(tmp); if(!IsNumeric(tmp)) return SendClientMessage(playerid, Red, "ERROR: Invalid Day! Only Numbers!"); if(strval(tmp) <= 0 || strval(tmp) > 1000) return SendClientMessage(playerid, Red, "ERROR: Invalid Day! (1-1000)"); new reason[128]; reason = strtok2(cmdtext,idx); if (!strlen(reason)) return SendClientMessage(playerid, Red, "ERROR: Reason not Specified!"); if (strlen(reason) <= 0 || strlen(reason) > 100) return SendClientMessage(playerid, Red, "ERROR: Invalid Reason length!"); new ip[15]; GetPlayerIp(giveplayerid,ip,15); GetPlayerName(playerid, name, sizeof name); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); new File:tempban = fopen("ZeroAdmin/Logs/TempBans.ban", io_append); if (tempban) { new year,month,day; getdate(year, month, day); day += days; if (IsMonth31(month)) { if (day > 31) { month += 1; if (month > 12) { year += 1; while(day > 31) day -= 31; } else while(day > 31) day -= 31; } } else if (!IsMonth31(month)) { if (day > 30) { month += 1; if (month > 12) { year += 1; while(day > 30) day -= 30; } else while(day > 30) day -= 30; } } else if (!IsMonth31(month) && IsMonth29(year) && month == 2) { if (day > 29) { month += 1; if (month > 12) { year += 1; while(day > 29) day -= 29; } else while(day > 29) day -= 29; } } else if (!IsMonth31(month) && !IsMonth29(year) && month == 2) { if (day > 28) { month += 1; if (month > 12) { year += 1; while(day > 28) day -= 28; } else while(day > 28) day -= 28; } } format(string, sizeof string, "%d|%d|%d|%s\n", day, month, year, ip); fwrite(tempban, string); fclose(tempban); } format(string,128,"Administrator %s Temporarily Banned %s for %d Day(s) Reason: %s",name,giveplayer,days,reason); SendClientMessageToAll(Red,string); Kick(giveplayerid); format(string, sizeof string, "Admin %s Temporarily Banned %s for %d Day(s) Reason: %s",name,giveplayer,days,reason); SaveLogs("TempBansLog",string); } else { SendClientMessage(playerid,Red,"ERROR: Player is not connected"); } } Pán chytrolín to je nejlepší co můžeš udělat zkopírovat kod a vložit ho do příkazu.. ono to možná zní jednoduché ale bohužel není.. Taková otázka když máš ten příkaz v CMD v klasickém tak ti to hází errory a nebo né ? Já si myslím že ti to musí házet errory i v tom základním příkazu. Link to comment Share on other sites More sharing options...
0 Mivčo 90 Odesláno: 10. Leden, 2015 Author Share Odesláno: 10. Leden, 2015 nehadze lebo to mám v OnPlayerCommandText( Link to comment Share on other sites More sharing options...
0 VolfikCZ 33 Odesláno: 10. Leden, 2015 Share Odesláno: 10. Leden, 2015 V tom příkazu ve kterém to děláš v ZCMD nesmíš použít strcmp používáš tam různe definice toho strcmp a ten ZCMD nepodporuje to ale spíš ano ale musíš to definovat atd..rači použí sscanf2 to bude jednoduchší pro tebe.. Link to comment Share on other sites More sharing options...
0 Mivčo 90 Odesláno: 10. Leden, 2015 Author Share Odesláno: 10. Leden, 2015 až taký dokonalí nie som VolfíkCZ Link to comment Share on other sites More sharing options...
0 VirginBuster 0 Odesláno: 10. Leden, 2015 Share Odesláno: 10. Leden, 2015 nemusí dvojku, ještě řešit pluginy...nahoře jsem mu nechal návod jak na to. Když se bude nudit a chtít to dodělat, tak si to udělá sám.... Link to comment Share on other sites More sharing options...
0 Mivčo 90 Odesláno: 10. Leden, 2015 Author Share Odesláno: 10. Leden, 2015 (upraveno) nemusí dvojku, ještě řešit pluginy...nahoře jsem mu nechal návod jak na to. Když se bude nudit a chtít to dodělat, tak si to udělá sám.... no tak ako to spravím... Edited 14. Leden, 2015 by Igan Link to comment Share on other sites More sharing options...
0 Mivčo 90 Odesláno: 14. Leden, 2015 Author Share Odesláno: 14. Leden, 2015 (upraveno) Pomôže mi niekto Edited 14. Leden, 2015 by Igan Link to comment Share on other sites More sharing options...
0 VirginBuster 0 Odesláno: 14. Leden, 2015 Share Odesláno: 14. Leden, 2015 COMMAND:mycommand(playerid, params[]) { //http://wiki.sa-mp.com/wiki/Sscanf_code //http://wiki.sa-mp.com/wiki/Fast_Commands hledej sscanf return 1; } Není to zase tak těžký. Trošičku se zamysli a pohledej si, vyzkoušej si /*=================================================================================================================== Zamysli se...já ti nechci předělávat celej příkaz, i když to je na chvíli. Nemám v pc Pawno. Předpokládám že umíš udělat ZCMD příkaz. Nahoru hodíš stock, uděláš příkaz, a do něj si celej příkaz uprav aby jel přes sscanf. Přes něj můžeš udělat víc parametrů. Máš tam tabulku písmen na ten parametr který určuje o jaký typ parametru se jedná. Pro jména/id používej u, čísla i, text s.... ===================================================================================================================*/ Link to comment Share on other sites More sharing options...
0 Mivčo 90 Odesláno: 14. Leden, 2015 Author Share Odesláno: 14. Leden, 2015 COMMAND:mycommand(playerid, params[]) { //http://wiki.sa-mp.com/wiki/Sscanf_code //http://wiki.sa-mp.com/wiki/Fast_Commands hledej sscanf return 1; } Není to zase tak těžký. Trošičku se zamysli a pohledej si, vyzkoušej si /*=================================================================================================================== Zamysli se...já ti nechci předělávat celej příkaz, i když to je na chvíli. Nemám v pc Pawno. Předpokládám že umíš udělat ZCMD příkaz. Nahoru hodíš stock, uděláš příkaz, a do něj si celej příkaz uprav aby jel přes sscanf. Přes něj můžeš udělat víc parametrů. Máš tam tabulku písmen na ten parametr který určuje o jaký typ parametru se jedná. Pro jména/id používej u, čísla i, text s.... ===================================================================================================================*/ stímto si mi ale pomohol Link to comment Share on other sites More sharing options...
0 Danny 37 Odesláno: 14. Leden, 2015 Share Odesláno: 14. Leden, 2015 Keď si myslíš že pomoc je to, že ti tu napíše celý skript ktorý si len skopíruješ, tak si na omyle. Link to comment Share on other sites More sharing options...
Dotaz
Mivčo 90
Zdravím.. ako by som dal z CMD do ZCMD tento príkaz n aby som tam neal tmp cmd a tak...?
Link to comment
Share on other sites
17 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now