Peršokti į turinį
**Extazy**

[GRP] Get systema su susitarimu + paaiskinimas

Recommended Posts

Sveiki visi siendien noriu ideti tuokia pamoka "Get systema su susitarimu".

Tai gi kas tai ?? Ji naudinga tuo kad kai rasai /get [Vardas_Pavardenis] jam ismeta lentele ir jis gales paspausti SUTINKU arba NESUTINKU. Jai jis paspaus sutinku tai ji atgetins iki kito zaidejo jai gu ne tai neatgetins.

Tai gi pradekim

Dekim si koda po admino komandu

   if(!strcmp(cmdtext, "/get", true,4))
 {
     if(cmdtext[4]==0){SendClientMessage(playerid, WHITE, "Atsiteleportuoti юaideja pas save: {FF0000}/get{00FF00} Dalis vardo"); return 1;}
     new vardas[MAX_PLAYER_NAME];
   strmid(vardas,cmdtext[5],0,MAX_PLAYER_NAME);
   new id = GetPlayeridMid(vardas);
  if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, RED, "Tokio юaidejo nera"); return 1;}
   if (playerDB[id][ikalintas]) {SendClientMessage(playerid, RED, "Юaidejas kalejime"); return 1;}
   playerDB[id][rid][0]=playerid;
         GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
  new msg[128]; format(msg, sizeof(msg), "{00FF00}Zaidejas {FF0000}%s {00FF00}tau siulo buti perkeltam pas ji\nAr sutinki?",vardas);
  ShowPlayerDialog(id,500,DIALOG_STYLE_MSGBOX,vardas , msg,"Sutikti","Nesutikti");
     return 1;
 }

Toliau po

public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])

Dedame si koda

if(dialogid == 500)
{
 if(response)
 {
    new id = playerDB[playerid][rid][0];
      new vardas[MAX_PLAYER_NAME];
    GetPlayerName(rid,vardas,sizeof(vardas));
   GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
  new msg[128]; format(msg,sizeof(msg), "Zaidejas %s sutiko buti perkeliamas.",vardas);
  SendClientMessage(id, GREEN, msg);
  new idas[MAX_PLAYER_NAME];
  GetPlayerName(id,idas,MAX_PLAYER_NAME);
  format(msg,sizeof(msg), "Buvai perkeltas pas zaideja %s",idas);
  SendClientMessage(playerid, GREEN, msg);

   SetPlayerInterior(playerid,GetPlayerInterior(id));
           if(!IsPlayerInAnyVehicle(playerid)){
  new Float:tempcoo[3];
   GetPlayerPos(id,tempcoo[0],tempcoo[1],tempcoo[2]);
   SetPlayerPos(playerid,tempcoo[0],tempcoo[1],tempcoo[2]);
   SetCameraBehindPlayer(playerid);
   }
   new Float:tempcoh[3];
   GetPlayerPos(id,tempcoh[0],tempcoh[1],tempcoh[2]);
   new vehicleid = GetPlayerVehicleID(playerid);
   SetVehiclePos(vehicleid,tempcoh[0],tempcoh[1],tempcoh[2]);
 }
 else
 {
 new id = playerDB[playerid][rid][0];
 new vardas[MAX_PLAYER_NAME];
 GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
  new msg[128]; format(msg,sizeof(msg), "Zaidejas %s nesutiko buti perkeliamas.",vardas);
  SendClientMessage(id, RED, msg);
 }
}

Paaiskinimai

if(!strcmp(cmdtext, "/get", true,4))

Tai yra komanda su kuria galesit gettint zaidejus

      new vardas[MAX_PLAYER_NAME];
   strmid(vardas,cmdtext[5],0,MAX_PLAYER_NAME);
   new id = GetPlayeridMid(vardas);
  if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, RED, "Tokio юaidejo nera"); return 1;}

Sitie kodai tikrina ar zaidejas yra siuo metu prisijunges ar ne jai gu ne tai negetins

    if (playerDB[id][ikalintas]) {SendClientMessage(playerid, RED, "Юaidejas kalejime"); return 1;}

Sitas kodas tikrina ar zaidejas ne kaleime jai gu jis ikalintas tai negetins zaidejo

    playerDB[id][rid][0]=playerid;
         GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
  new msg[128]; format(msg, sizeof(msg), "{00FF00}Zaidejas {FF0000}%s {00FF00}tau siulo buti perkeltam pas ji\nAr sutinki?",vardas);

Sitie kodai siulo zaidejui kad jis sutiktu buti atgetintam

   ShowPlayerDialog(id,500,DIALOG_STYLE_MSGBOX,vardas , msg,"Sutikti","Nesutikti");
     return 1;

Sitas kodas nustato dialoga

if(dialogid == 500)

Nustato dialoga

     new id = playerDB[playerid][rid][0];
      new vardas[MAX_PLAYER_NAME];
    GetPlayerName(rid,vardas,sizeof(vardas));
   GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
  new msg[128]; format(msg,sizeof(msg), "Zaidejas %s sutiko buti perkeliamas.",vardas);

Sitie kodai tikrina ar zaidejas sutiko

   SendClientMessage(id, GREEN, msg);
  new idas[MAX_PLAYER_NAME];
  GetPlayerName(id,idas,MAX_PLAYER_NAME);
  format(msg,sizeof(msg), "Buvai perkeltas pas zaideja %s",idas);
  SendClientMessage(playerid, GREEN, msg);

Sitie kodai raso pas ka buvo perkeltas zaidejas

 SetPlayerInterior(playerid,GetPlayerInterior(id));
           if(!IsPlayerInAnyVehicle(playerid)){
  new Float:tempcoo[3];
   GetPlayerPos(id,tempcoo[0],tempcoo[1],tempcoo[2]);
   SetPlayerPos(playerid,tempcoo[0],tempcoo[1],tempcoo[2]);
   SetCameraBehindPlayer(playerid);

Sitie kodai gettina zaideju

 new Float:tempcoh[3];
   GetPlayerPos(id,tempcoh[0],tempcoh[1],tempcoh[2]);
   new vehicleid = GetPlayerVehicleID(playerid);
   SetVehiclePos(vehicleid,tempcoh[0],tempcoh[1],tempcoh[2]);
 }
 else
 {
 new id = playerDB[playerid][rid][0];
 new vardas[MAX_PLAYER_NAME];
 GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
  new msg[128]; format(msg,sizeof(msg), "Zaidejas %s nesutiko buti perkeliamas.",vardas);
  SendClientMessage(id, RED, msg);

Na o sitie kodai negetina zaidejaus jai jis nesutiko

Na ir viskas jai praverte nepagailek ir +r3p

Dalintis šį pranešimą


Nuoroda iki šio pranešimo
Dalintis per kitą puslapį


Svečias
Ši tema yra užrakinta.

  • Narių peržiūri šį forumą:   0 nariai

    Nėra registruotų narių peržiūrinčių šį forumą.


  • SuperGames programele
  • SuperGames programele


×