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

Hi !!!

I got A question im using Raven roleplay script and i was wondering if anyone can tell me, how Do i create if someone buys a mask from the 24/7 that if you call someone or use /advertise that your name will be set as Anyonemouse

here is is the /advertise pawn
Quote:

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][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 is the /maskon pawn
Quote:

if(strcmp(cmd, "/maskon", true) == 0) // by CuervO_NegrO
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMask] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "** You don't have a mask");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 5)
{
SendClientMessage(playerid, COLOR_GRAD1, "** You are not able to use it.");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
PlayerInfo[playerid][pMaskuse] = 1;
SendClientMessage(playerid, COLOR_WHITE, "** You have put your mask on [/maskoff to put it away].");
format(string, sizeof(string), "* %s puts a mask on.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
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 [CMD] -> /maskon",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
return 1;
}

And here the /call pawn

Quote:

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;
}

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);
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;
}

Help me please Thanks for reading!
Reply
#2

Код:
new IsPlayerInMaskMode[MAX_PLAYERS];//This will go under your /mask command.

//OnPlayerText...

if(IsPlayerInMaskMode[playerid] == 1)
{
    //Show there message however you like it to.
}
else
{
    //Show normal messages(Without mask)
}
Reply
#3

ill try it right now thx anyway ill let you know if it works
Reply
#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
#5

Thankss yey !
Reply
#6

C:\Users\Snor!\Desktop\Real Life [ENG]\gamemodes\Dodke.pwn(39803) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Snor!\Desktop\Real Life [ENG]\gamemodes\Dodke.pwn(39803) : error 029: invalid expression, assumed zero
C:\Users\Snor!\Desktop\Real Life [ENG]\gamemodes\Dodke.pwn(39803) : error 017: undefined symbol "d"
C:\Users\Snor!\Desktop\Real Life [ENG]\gamemodes\Dodke.pwn(39803) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
?
Reply
#7

I'm sorry I seem to have forgotten to remove a ".
Change
pawn Код:
format(string, sizeof(string), "ADVERTISEMENT": %s, Anonymous (Phone: %d)", result, PlayerInfo[playerid][pPnumber]);
to
pawn Код:
format(string, sizeof(string), "ADVERTISEMENT: %s, Anonymous (Phone: %d)", result, PlayerInfo[playerid][pPnumber]);
Reply
#8

may i ask you can you put it all on pastebin ? i dont know how i need to move it forward with spacebar
Reply
#9

im new to all this scripter pros But still thanks alot for helping already ^^ couldt u please put those advertise and /call on pastebin files with spacebar etc that i dont need to put all good in lines ? wouldt be great
Reply
#10

Here you go.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)