zcmd&sscanf
#1

Hello ,my friends! I need help, with zcmd&ssanf


Код:
COMMAND:priimt(playerid,params[])
{
	        if(!cmdtext[7])
	        {
				SendClientMessage(playerid,BLUE,"* Priimti zaideja i savo firma: /priimt [vardo dalis]");
				return 1;
			}
            if(playerDB[playerid][specialybe]==20){SendClientMessage(playerid,RED,"* Tokios komandos nera!"); return 1;}
			new name[MAX_PLAYER_NAME];
			strmid(name,cmdtext[8],0,sizeof(name));
			new id = GetPlayeridMid(name);


			if(id == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid,RED,"* Nurodyto zaidejo nera.");
				return 1;
			}

			if(playerDB[id][leanvited][playerDB[playerid][plead]-1] || playerDB[id][specialybe] == GetJobFromFaction(playerDB[playerid][plead]))
			{
				SendClientMessage(playerid,RED,"* Zaidejas jau priimtas.");
				return 1;
			}

			GetPlayerName(id,name,sizeof(name));

			if(playerDB[playerid][plead] == LEAD_FARAI) SendClientMessage(id,RED,"* Jus kvieciamas dirbti Policininku. Jei norite istoti, atvykite i policijos deportamenta.");
			else if(playerDB[playerid][plead] == LEAD_MEDIKAI) SendClientMessage(id,RED,"* Jus kvieciamas dirbti Mediku. Jei norite istoti, atvykite i ligonines darbuotoju sektoriu.");
			else if(playerDB[playerid][plead] == LEAD_TIUNING) SendClientMessage(id,RED,"* Jus kvieciamas dirbti Tuning shop, jei norite, prisistatykit prie tiuningines !");
			else if(playerDB[playerid][plead] == LEAD_MECH) SendClientMessage(id,RED,"* Jus kvieciamas dirbti Mechaniku, jei norite, prisistatykit i firma.");
   			else if(playerDB[playerid][plead] == LEAD_SKELBIULT) SendClientMessage(id,RED,"* Jus kvieciamas dirbti skelbiu.lt, jei norite, prisistatykit i musu firma");
   			else if(playerDB[playerid][plead] == LEAD_SAMDOMI) SendClientMessage(id,RED,"* Jus kvieciamas dirbti samdomu zudiku, jei norite, prisistatykit i musu firma");
   			else if(playerDB[playerid][plead] == LEAD_APSAUGA) SendClientMessage(id,RED,"* Jus kvieciamas dirbti i apsauga, jei norite, prisistatykit i musu firma");
   			else if(playerDB[playerid][plead] == LEAD_AZTEC) SendClientMessage(id,RED,"* Jus kvieciamas Los Aztecas gauja, jei norite, prisistatykit i bustine");
   			else if(playerDB[playerid][plead] == LEAD_RIFAS) SendClientMessage(id,RED,"* Jus kvieciamas San Fierro Rifa gauja, jei norite, prisistatykit i bustine");
   			else if(playerDB[playerid][plead] == LEAD_BAIKERIAI) SendClientMessage(id,RED,"* Jus kvieciamas Baikeriu gauja, jei norite, prisistatykit i bustine");
   			else if(playerDB[playerid][plead] == LEAD_DRIFTKL) SendClientMessage(id,RED,"* Jus kvieciamas i Drifteriu kluba, jei norite, prisistatykit i bustine");
   			else if(playerDB[playerid][plead] == LEAD_DRAGKL) SendClientMessage(id,RED,"* Jus kvieciamas i Drageriu kluba, jei norite, prisistatykit i bustine");
   			else if(playerDB[playerid][plead] == LEAD_ARMIJA) SendClientMessage(id,RED,"* Jus kvieciamas i Armija, jei norite, prisistatykit i musu baze");
			else SendClientMessage(id,RED,"* Jus kvieciamas dirbti Rometra taksi. Jei nori atvyk i musu firma.");

			playerDB[id][leanvited][playerDB[playerid][plead]-1]=true;
			new msg[128];
			format(msg,sizeof(msg),"Pakvietete %s istoti i jusu firma.",name);
			SendClientMessage(playerid,GREY,msg);
			return 1;
		}
Im newbie with zcmd, so i need help

Код:
    if(!cmdtext[7])
	        {
				SendClientMessage(playerid,BLUE,"* Priimti zaideja i savo firma: /priimt [vardo dalis]");
				return 1;
			}
Reply
#2

pawn Код:
if(playerDB[playerid][specialybe]==20) return SendClientMessage(playerid,RED,"* Tokios komandos nera!");
new id, name[MAX_PLAYER_NAME];
if(sscanf(params, "u", id)) return SendClientMessage(playerid,BLUE,"* Priimti zaideja i savo firma: /priimt [vardo dalis]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,RED,"* Nurodyto zaidejo nera.");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)