GTAvision.com - Forum - Grand Theft Auto News, Downloads, Community and more...

Position: Grand Theft Auto: San Andreas » Multiplayer » [SA-MP] Hilfe zu Jail! » Druckansicht
Ginchen12, 01.08.2007, 20:57
Hi Leute!
Habe ne Frage zu Jail/Unjail und Easy Functions!

Jail und Unjail funzen super. Aber ich möchte dass nur Admins /jail und /unjail anwenden können!
Also habe ich EasyFunctions angewendet!

public IsPlayerAdmin(playerid)
{
if(deinevariablediegechecktwerdensoll[playerid] == 1){
return 1;
}
return 0;
}

Weiß leider net, was ich weiter eintrage muss. :(

Help!!!
Rafioso, 01.08.2007, 21:55
Versuch es am Besten mal so:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public OnPlayerCommandText(playerid, cmdtext[])
{
   new cmd[256];
   new idx;
    cmd = strtok(cmdtext, idx);
    
    if((strcmp(cmd, "/jail", true) == 0)&&(IsPlayerAdmin(playerid) == 1))
      {
//Hier kommt der Jail-Code rein.
      return 1;
      }
   return 0;
}


// Das kommt außerhalb eines puplics:

strtok(const string[], &index)
{
   new length = strlen(string);
   while ((index < length) && (string[index] <= ' '))
   {
      index++;
   }

   new offset = index;
   new result[20];
   while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
   {
      result[index - offset] = string[index];
      index++;
   }
   result[index - offset] = EOS;
   return result;
}


=) =) :D :D =) =)
GTAvision.com :: Forumregeln :: FAQ :: Impressum :: Kontakt :: RDRvision.com :: LANOIREvision.com :: MaxPayneVision.com
NetVisionWork.NET
.: © 2006-2014 by GTAvision.com :.

Rockstar GamesTake-Two Interactive Deutschland

Free Grand Theft Auto Downloads