17.08.2013, 16:53
Hello, how should I make a ZCMD call command e.g. /call [id/Part of nick] because I have call command which uses telephone number, but I need to change it to name
This is the script, how should I make it to call to PlayerNAme?
Код HTML:
COMMAND:skambinti(playerid,params[])
{
if(zInfo[playerid][TelNr] == 0) return ErrorMsg(playerid,"Jūs Neturite {FFFFFF}Telefono.");
else if(zInfo[playerid][TelNr] < 0) return ErrorMsg(playerid,"Jūsų Telefonas Yra {FFFFFF}Iљjungtas.");
new nr;
if(sscanf(params,"d",nr)) return InfoMsg(playerid,"Skambinti Telefonu: {FFFFFF}[ /Skambinti Vardas_Pavardė ]");
else if(zInfo[playerid][Pasnekovas] != -1) return ErrorMsg(playerid,"Jūs Jau Naudojate {FFFFFF}Telefoną.");
else if(nr < 60000 || strlen(params) < 4 || strlen(params) > 6)
{
Telefonas(playerid,"Tokio~n~Numerio~n~Nera",true);
KillTimer(TelefonoTimer[playerid]);
TelefonoTimer[playerid] = SetTimerEx("SlepiamTelefona",2500,false,"d",playerid);
return 1;
}
foreach(Player,i)
{
if(zInfo[i][TelNr] > 0)
{
if(zInfo[i][TelNr] == nr)
{
if(i == playerid)
{
Telefonas(playerid,"Numeris~n~Uzimtas",true);
KillTimer(TelefonoTimer[playerid]);
TelefonoTimer[playerid] = SetTimerEx("SlepiamTelefona",2500,false,"d",playerid);
return 1;
}
else if(zInfo[i][Pasnekovas] != -1)
{
Telefonas(playerid,"Numeris~n~Uzimtas",true);
KillTimer(TelefonoTimer[playerid]);
TelefonoTimer[playerid] = SetTimerEx("SlepiamTelefona",2500,false,"d",playerid);
return 1;
}
new msg[55];
zInfo[playerid][Pasnekovas] = i+2;
zInfo[i][Pasnekovas] = playerid+2;
format(msg,40,"Skambinate~n~~n~~y~%d~n~~r~[ /Atmesti ]",nr);
KillTimer(TelefonoTimer[playerid]);
Telefonas(playerid,msg,true);
zInfo[playerid][Pasnekovas] *= -1;
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
Pranesam(playerid,"Pasiima Telefoną Ir Surenka Numerį.");
format(msg,55,"Skambina~n~~y~%s~n~~n~~g~[ /Atsiliepti ]~n~~r~[ /Atmesti ]",zVardas(playerid));
KillTimer(TelefonoTimer[i]);
Telefonas(i,msg,true);
Pranesam(i,"Suskamba {FFFFFF}Telefonas.");
return 1;
}
Telefonas(playerid,"Uz Rysio~n~Zonos Ribu",true);
KillTimer(TelefonoTimer[playerid]);
TelefonoTimer[playerid] = SetTimerEx("SlepiamTelefona",2500,false,"d",playerid);
}
else
{
if(zInfo[i][TelNr] == nr*-1)
{
Telefonas(playerid,"Uz Rysio~n~Zonos Ribu",true);
KillTimer(TelefonoTimer[playerid]);
TelefonoTimer[playerid] = SetTimerEx("SlepiamTelefona",2500,false,"d",playerid);
return 1;
}
}
}
return 1;
}