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



?
format(string, sizeof(string), "ADVERTISEMENT": %s, Anonymous (Phone: %d)", result, PlayerInfo[playerid][pPnumber]);
format(string, sizeof(string), "ADVERTISEMENT: %s, Anonymous (Phone: %d)", result, PlayerInfo[playerid][pPnumber]);
? i dont know how i need to move it forward with spacebar
? wouldt be great