Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-12-24, 14:19


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Nie.. Te komendy s? tak ?a?osne, ?e przebrn??em tylko przez pare, reszte r?b sobie sam, wzoruj si? w/e.

Kod:

new string[144];

CMD:mandat(playerid, p[])
{
if(isnull(p)) return SendClientMessage(playerid, -1, "/mandat [id gracza] [kwota] [powod]"), true;
new id, kwota, powod[64];
sscanf(p, "uds[64]", id, kwota, powod);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Gracz, kt?rego wybra?e? nie widnieje na serwerze!"), true;
//---Wiadomo?c dla wpisanego id---//
format(string, 144, "Dosta?e? mandat");
SendClientMessage(id, COLOR_LIGHTGREEN, string);
format(string, 144, "Kwota mandatu: %d",kwota);
SendClientMessage(id, COLOR_GREY, string);
format(string, 144, "Powod mandatu: %s",powod);
SendClientMessage(id, COLOR_GREY, string);
format(string, 144, "Zap?a? go jak najszybciej na komisariacie policji!");
SendClientMessage(id, COLOR_GREY, string);
GivePlayerMoney(id, -kwota);
//---Wiadomo?? dla policjanta---//
format(string, 144, "Wystawi?e? mandat");
SendClientMessage(id, COLOR_LIGHTGREEN, string);
format(string, 144, "Kwota mandatu: %d",kwota);
SendClientMessage(id, COLOR_GREY, string);
format(string, 144, "Powod mandatu: %s",powod);
SendClientMessage(id, COLOR_GREY, string);
return true;
}

CMD:alkomat(playerid, p[])
{
if(isnull(p)) return SendClientMessage(playerid, -1, "/alkomat [id gracza]"), true;
new id;
id = strval(p);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Gracz, kt?rego wybra?e? nie widnieje na serwerze!"), true;
format(string, 144, "{00FF00}Gracz {FFFFFF}%s(%d) {00FF00}ma {FFFFFF}%d {00FF00}promila we krwi", PlayerName(id), id, promile[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return true;
}

CMD:dmucham(playerid, p[])
{
SendClientMessage(playerid, COLOR_GREY, "Dmuchasz w alkomat...");
format(string, 144, "{00FF00}Gracz {FFFFFF}%s {00FF00}dmucha w alkomat...", PlayerName(playerid));
SendMessageToPolicja(COLOR_GREY, string);
return true;
}

CMD:g1(playerid, p[])
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1717.1254,1615.0798,10.1364))
{
MoveObject(glvlot, 1703.0000000,1597.1999500,11.8000000, 1.0);
SetTimerEx("glvlotc", 15000, false, "i", playerid);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1698.8745,1601.7946,10.5979))
{
MoveObject(glvlot, 1703.0000000,1597.1999500,11.8000000, 1.0);
SetTimerEx("glvlotc", 15000, false, "i", playerid);
}
return true;
}

CMD:open(playerid, p[])
{
if(gTeam[playerid] != TEAM_LIDL) return true;
MoveObject(lidl, 2887.8999000,2046.1999500,7.3000000, 1.0);
SetTimerEx("lidlc", 10000, false, "i", playerid);
return true;
}

CMD:odznaka(playerid, p[])
{
if(gTeam[playerid] != TEAM_POLICJA) return true;
if(isnull(p)) return SendClientMessage(playerid, -1, "/odznaka [id gracza]"), true;
new id;
id = strval(p);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Gracz, kt?rego wybra?e? nie widnieje na serwerze!"), true;
SendClientMessage(playerid, COLOR_GREY, "# Pokaza?e? graczowi odznake policyjn?!");
format(string, 144, "# Policjant %s pokazuje ci odznake.", PlayerName(playerid));
SendClientMessage(id, COLOR_GREEN, string);
new _message[255];
format(_message, 255, "{FFFFFF}---------{{0080FF}ODZNAKA POLICYJNA{FFFFFF}}---------\n{FFFFFF} Imi?: %s \n{FFFFFF} Komenda g??wna policji \n{FFFFFF}----------------------------------------------------------\n", PlayerName(playerid));
ShowPlayerDialog(id, 11, DIALOG_STYLE_MSGBOX, "Odznaka", _message, "Ok", "Zamknij");
return true;
}

CMD:s(playerid, p[])
{
if(gTeam[playerid != TEAM_POLICJA) return true;
if(isnull(p)) return SendClientMessage(playerid, COLOR_WHITE, "/s [id gracza] - tylko podczas po?cigu"), true;
new id;
id = strval(p);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Gracz, kt?rego wybra?e? nie widnieje na serwerze!"), true;
SendClientMessage(playerid, COLOR_GREY, "# Wys?a?e? graczowi wiadomo??!");
SendClientMessage(playerid, COLOR_GREY, "# Postrzeli?e? gracza!");
SendClientMessage(id, COLOR_LIGHTRED, "# St?j policja. Zatrzymaj sie");
SendClientMessage(id, COLOR_GREEN, "# Zosta?e? postrzelony przez policjanta, i sie przewr?ci?e?!");
SetPlayerHealth(id, 85.0);
TogglePlayerControllable(id,0);
ApplyAnimation(id, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0);
SetTimerEx("wywrotka", 5000, false, "i", id);
return true;
}

stock PlayerName(pid)
{
new n[21];
GetPlayerName(pid, n, 21);
return n;
}


Postaw piwo autorowi tego posta
 

 
Tagi: tworzenie :: komend :: sscanf?
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [INNE] Tworzenie komend sscanf? Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku