Help me with mask system please ! ^_^
#4

Advertise PAWN
Код:
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "** You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/ad)vertise [advert text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "** Please try again later %d seconds between Advertisements !", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
SafeGivePlayerMoney(playerid, -50);
format(string, sizeof(string), "ADVERTISEMENT: %s, contact %s (Phone: %d)", result, sendername ,PlayerInfo[playerid][pPnumber]);
SendClientMessageToAll(COLOR_ORANGE,string);
GameTextForPlayer(playerid, "~w~Advertisement ~n~~w~Price:~g~$50", 4321,1);
if(PlayerInfo[playerid][pMask] == 1)
{
format(string, sizeof(string), "ADVERTISEMENT": %s, Anonymous (Phone: %d)", result, PlayerInfo[playerid][pPnumber]);
SendClientMessageToAll(COLOR_ORANGE, string);
GameTextForPlayer(playerid, "~w~Advertisement ~n~~w~Price:~g~$50", 4321,1);
}
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
new y,m,d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (Advertisement): %s",d,m,y,h,mi,s, sendername, result);
ChatLog(string);
}
return 1;
}
And here's the /call I edited for you

Код:
if(strcmp(cmd, "/call", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /call [phonenumber]");
SendClientMessage(playerid, COLOR_GRAD2, "HINT: /calllist (for a list for short numbers)");
return 1;
}
if(PlayerInfo[playerid][pPnumber] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "** You don't have a cell phone!");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
if(PlayerInfo[playerid][pMask] == 0)
{
format(string, sizeof(string), "* %s takes out a cellphone.", sendername);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
new phonenumb = strval(tmp);
}
else
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
ProxDetector(30.0, playerid, "Anonymous takes out a cellphone.", COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
new phonenumb = strval(tmp);
}

if(phonenumb == 115)

{
SendClientMessage(playerid, COLOR_GREEN, "____________Services number list____________");
SendClientMessage(playerid, COLOR_WHITE, "111 - pizza stack co., 222 - bus services");
SendClientMessage(playerid, COLOR_WHITE, "103 - medics, 444 - taxi, 555 - mechanic");
SendClientMessage(playerid, COLOR_WHITE, "151 - Advertisement Agency, 150 - ABC Studios");
SendClientMessage(playerid, COLOR_GREEN, "____________________________________________" );
return 1;
}
There you go!
Reply


Messages In This Thread
Help me with mask system please ! ^_^ - by miley1 - 01.05.2012, 01:52
Re: Help me with mask system please ! ^_^ - by warcodes_ - 01.05.2012, 06:00
Re: Help me with mask system please ! ^_^ - by miley1 - 01.05.2012, 07:02
Re: Help me with mask system please ! ^_^ - by Prostilov - 01.05.2012, 07:03
Re: Help me with mask system please ! ^_^ - by miley1 - 01.05.2012, 07:33
Re: Help me with mask system please ! ^_^ - by miley1 - 01.05.2012, 07:37
Re: Help me with mask system please ! ^_^ - by Prostilov - 01.05.2012, 07:42
Re: Help me with mask system please ! ^_^ - by miley1 - 01.05.2012, 07:45
Re: Help me with mask system please ! ^_^ - by miley1 - 01.05.2012, 07:49
Re: Help me with mask system please ! ^_^ - by Prostilov - 01.05.2012, 07:52

Forum Jump:


Users browsing this thread: 1 Guest(s)