23.12.2012, 16:33
I tried to do a phone system, actually I've seen so many tutorial's but nothing helped me. First I scripted the /call, tested it and It works, now If Im not wrong to continue this system, I need /pickup and /hangup. Anyone who can give me a tip for that? Here is the /call
PHP код:
if(strcmp(cmd, "/call", true) == 0) {
if(UserInfo[playerid][uPhone] == 1) {
new string[200];
new number;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_GREY, "USAGE: /call [number]");
return 1;
}
number = strval(tmp);
new pnumber = UserInfo[playerid][uNumber];
if(UsingPhone[playerid] == 0) {
GetPlayerName(playerid, pname, 24);
GiveNameSpace(pname);
if(Masked[playerid] == 1) {
format(pname, sizeof(pname), "[Mask_%d_%d]", UserInfo[playerid][uID], RandMask[playerid]);
}
format(string, sizeof(string), "* %s takes out a cellphone.", pname);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
CallNumber(playerid, number, pnumber);
ApplyAnimation(playerid,"PED","phone_in",4.1,0,1,1,1,0);
return 1;
}
else {
SendClientMessage(playerid, COLOR_GREY, "You are already making a call, use /hangup!");
return 1;
}
}
else {
SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have a cellphone!");
return 1;
}