SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 14/08/2010, 09:08 AM   #1
OmarEco
Huge Clucker
 
OmarEco's Avatar
 
Join Date: Jun 2010
Location: Egypt
Posts: 291
Reputation: 0
Default need some help

all know this
Code:
AdminLvl[playerid] = 0;
i want to us it by command like
Code:
    if (!strcmp("/blabal", cmdtext))


        {
        SendClientMessage(playerid, 0xFFFFFFFF, "test");
        SendClientMessage(playerid, 0xFFFFFFFF, "test");
        }
        return 1;
i want use i
Code:
AdminLvl[playerid] = 0;
in this and set it to 1 when he use command frist time and send message when he use command again and AdminLvl[playerid] = 0; seted to 1 how this
OmarEco is offline  
Old 14/08/2010, 09:13 AM   #2
Arrows73
Big Clucker
 
Arrows73's Avatar
 
Join Date: Jan 2009
Posts: 141
Reputation: 2
Default Re: need some help

I dont understand your post completely, but do you want to do something like this?

Code:
if (!strcmp("/admin", cmdtext))
{
      if (AdminLvl[playerid])
      {
           AdminLvl[playerid] = 0;
           SendClientMessage(playerid, 0xFFFFFFFF, "You are not an admin anymore");
      }
      else
       {
            AdminLvl[playerid] = 1;
            SendClientMessage(playerid, 0xFFFFFFFF, "You are an admin now");
       }
      return 1;
}
Arrows73 is offline  
Old 14/08/2010, 09:14 AM   #3
OmarEco
Huge Clucker
 
OmarEco's Avatar
 
Join Date: Jun 2010
Location: Egypt
Posts: 291
Reputation: 0
Default Re: need some help

you know line AdminLvl[playerid] = 0;
i want change 0 to 1
OmarEco is offline  
Old 14/08/2010, 09:16 AM   #4
OmarEco
Huge Clucker
 
OmarEco's Avatar
 
Join Date: Jun 2010
Location: Egypt
Posts: 291
Reputation: 0
Default Re: need some help

i do this command
Code:
    if (!strcmp("/repair", cmdtext))
    {

        {
        if(command== 0)
        {
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "You repaired your vehicle");
        }
        if(command== 1)
		{
		SendClientMessage(playerid,0xF5260FFF,"You already uses this command in this round");
		}
        }
and need under line SendClientMessage(playerid, 0xFFFFFFFF, "You repaired your vehicle"); set command 0 to command 1
OmarEco is offline  
Old 14/08/2010, 09:24 AM   #5
billiout
Huge Clucker
 
billiout's Avatar
 
Join Date: Apr 2010
Location: Greece
Posts: 244
Reputation: 0
Default Re: need some help

Code:
//on the top of your script
new command[MAX_PLAYERS];

//on OnPlayerCommandText
if (!strcmp("/repair", cmdtext))
    {

        {
        if(command[playerid] == 0)
        {
        RepairVehicle(GetPlayerVehicleID(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, "You repaired your vehicle");
        command[playerid] = 1;
        }
        if(command[playerid] == 1)
		{
		SendClientMessage(playerid,0xF5260FFF,"You already uses this command in this round");
		}
        }
__________________
Click here for my toolkit.
billiout is offline  
Old 14/08/2010, 09:25 AM   #6
OmarEco
Huge Clucker
 
OmarEco's Avatar
 
Join Date: Jun 2010
Location: Egypt
Posts: 291
Reputation: 0
Default Re: need some help

E:\www.mini-ex-missions.tk\sumo.pwn(96) : error 028: invalid subscript (not an array or too many subscripts): "command"
E:\www.mini-ex-missions.tk\sumo.pwn(96) : warning 215: expression has no effect
E:\www.mini-ex-missions.tk\sumo.pwn(96) : error 001: expected token: ";", but found "]"
E:\www.mini-ex-missions.tk\sumo.pwn(96) : error 029: invalid expression, assumed zero
E:\www.mini-ex-missions.tk\sumo.pwn(96) : fatal error 107: too many error messages on one line
OmarEco is offline  
Old 14/08/2010, 09:33 AM   #7
Claude
Huge Clucker
 
Claude's Avatar
 
Join Date: Aug 2010
Posts: 246
Reputation: 5
Default Re: need some help

pawn Code:
new command[MAX_PLAYERS];


if (!strcmp("/repair", cmdtext))
{
    if(command[playerid] == 1)  return SendClientMessage(playerid,0xF5260FFF,"You already uses this command in this round");
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, 0xFFFFFFFF, "You repaired your vehicle");
    command[playerid] = 1;
    return 1;
}
Claude is offline  
Old 14/08/2010, 09:36 AM   #8
OmarEco
Huge Clucker
 
OmarEco's Avatar
 
Join Date: Jun 2010
Location: Egypt
Posts: 291
Reputation: 0
Default Re: need some help

oh repaired i get the error its new command[MAX_PLAYERS];
OmarEco is offline  
Old 14/08/2010, 09:41 AM   #9
OmarEco
Huge Clucker
 
OmarEco's Avatar
 
Join Date: Jun 2010
Location: Egypt
Posts: 291
Reputation: 0
Default Re: need some help

how i repair this Warnings
Code:
E:\www.mini-ex-missions.tk\gamemodes\sumo.pwn(80) : warning 202: number of arguments does not match definition
E:\www.mini-ex-missions.tk\gamemodes\sumo.pwn(84) : warning 202: number of arguments does not match definition
E:\www.mini-ex-missions.tk\gamemodes\sumo.pwn(86) : warning 202: number of arguments does not match definition
E:\www.mini-ex-missions.tk\gamemodes\sumo.pwn(117) : warning 202: number of arguments does not match definition
E:\www.mini-ex-missions.tk\gamemodes\sumo.pwn(117) : warning 202: number of arguments does not match definition
E:\www.mini-ex-missions.tk\gamemodes\sumo.pwn(225) : warning 202: number of arguments does not match definition
E:\www.mini-ex-missions.tk\gamemodes\sumo.pwn(292) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


7 Warnings.
lines
Code:
	new plname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, plname, sizeof(plname));
	SetPlayerName(playerid,"%s_servers",plname);
    SendClientMessage(playerid,0x33FF33AA,"[Server] If You want to make a map please visit %s",ForumName);
    SendClientMessageToAll(0xAFAFAFAA,"[Server] Player %s Has joined the game",plname);
RemovePlayerFromGame();
	SendClientMessageToAll(0x33CCFFAA,"[Server] Player %s Has Left The server", name);
	GameTextForAll("%s has won the round! Next round will be starting in 10 seconds.",5000,50, name);
OmarEco is offline  
Old 14/08/2010, 09:44 AM   #10
Claude
Huge Clucker
 
Claude's Avatar
 
Join Date: Aug 2010
Posts: 246
Reputation: 5
Default Re: need some help

Use "format" find it on the wiki
Claude is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 09:12 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.