09.07.2010, 23:40
(
Последний раз редактировалось StreetGT; 09.07.2010 в 23:50.
)
Код:
if(strcmp(cmd, "/kill", true) == 0) { if(IsPlayerConnected(playerid)) { SetPlayerHealth(playerid,0.0); } return 1; } if(strcmp(cmd, "/elegy", true) == 0) { if(IsPlayerConnected(playerid)) { new Float:pX,Float:pY,Float:pZ; GetPlayerPos(playerid,pX,pY,pZ); AddStaticVehicleEx(562,pX,pY,pZ,0,-1,-1,-1); } return 1; }
Код:
new countdown; if(strcmp(cmd, "/countdown", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] < 1333) { SendClientMessage(playerid, COLOR_GRAD1, " Tu nao es admin! "); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAR: /countdown [tempo] em segundos !!!!!"); return 1; } new cd = strval(tmp); if(cd != 0) { countdown = cd+1; } } return 1; } public RaceTimer() { if(countdown != 0) { if(countdown == 1) { GameTextForAll("~g~GO!", 3000, 6); PlaySoundToAll(1057); } else { new string[20], randt[20]; new rand = random(4); if(rand == 0) { randt = "~y~"; } if(rand == 1) { randt = "~r~"; } if(rand == 2) { randt = "~b~"; } if(rand == 3) { randt = "~w~"; } format(string, sizeof(string), "%s %d", randt, countdown-1); GameTextForAll(string, 2000, 6); } countdown -=1; } }
Код:
if(strcmp(cmd, "/privatemessage", true) == 0 || strcmp(cmd, "/pm", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, "Nao esta logado!"); return 1; } if(PlayerInfo[playerid][pMuted] == 1) { SendClientMessage(playerid, TEAM_CYAN_COLOR, "Tu estas silenciado!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAR: (/pm)essage [JogaforID/ParteDoNome] [texto]"); return 1; } giveplayerid = ReturnUser(tmp); if (IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { new Float:xx, Float:yy, Float:zz; GetPlayerPos(giveplayerid, xx, yy, zz); GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); if(AFK[giveplayerid] == 1) { SendClientMessage(playerid, COLOR_GRAD2, "Este jogador esta afk!"); return 1; } if(giveplayerid == playerid) { format(string, sizeof(string), "* %s escreveu uma mensagem privada", sendername); ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; 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: (/pm)essage [JogadorID/ParteDoNome] [texto]"); return 1; } format(string, sizeof(string), "%s(ID: %d) diz: %s", sendername, playerid, (result)); SendClientMessage(giveplayerid, COLOR_YELLOW, string); format(string, sizeof(string), "O jogador %s(ID %d) disse: %s", giveplayer, giveplayerid, (result)); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } } else { format(string, sizeof(string), "%d nao e um jogador online.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }
Код:
if (strcmp(cmd, "/admins", true) == 0) { if(IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "Admin: %s", sendername); SendClientMessage(playerid, COLOR_GRAD2, string); } } } } return 1; }
Код:
else if(strcmp(cmd, "/eu", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, "Tu nao estas logado!"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; 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, "USAR: /eu [accao]"); return 1; } format(string, sizeof(string), "* %s : %s", sendername, result); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); printf("%s", string); } return 1; }