CMD:setleader(playerid, params[]) { new id; if(admin[playerid] < 3) return SendClientMessage(playerid, 0xFF000000, "Your not an admin with right lvl."); if(IsPlayerInRangeOfPoint(playerid, 7.0, 2512.8247,-1664.4379,13.5784)) return SendClientMessage(playerid, 0xFF000000, "Go to the HQ you want to set the leader."); if(sscanf(params,"ui", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setleader [id]"); SendClientMessage(id, 0x99FF0000, "~You have been made an leader of Grove Street Families~"); SendClientMessage(playerid, 0x99FF0000, "Leader have been set!"); gsfmember[id] = 2; return 1; }
if(request[id] == 2) return SendClientMessage(playerid, 0xFF000000, "This player is not requesting to join your organization!");
if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setleader [id]");
CMD:setmember(playerid, params[])
{
new id;
if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
SendClientMessage(id, 0x99FF0000, "~You have been made a member of Grove Street Families~");
SendClientMessage(playerid, 0x99FF0000, "Member have been set!");
gsfmember[id] = 1;
return 1;
}
// top of script
new
bool: Requested[ MAX_PLAYERS ] = false
;
CMD:request( playerid )
{
if( Requested[ playerid ] == true )
{
SendClientMessage( playerid, -1, "You already requested" );
}
else
{
Requested[ playerid ] = false;
}
return 1;
}
CMD:setmember(playerid, params[])
{
new id;
if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
if(Requested[ id ] == false)
{
SendClientMessage(id, 0x99FF0000, "~You have been made a member of Grove Street Families~");
SendClientMessage(playerid, 0x99FF0000, "Member have been set!");
gsfmember[id] = 1;
}
return 1;
}
Orgsystem.pwn(329) : error 029: invalid expression, assumed zero
CMD:setmember(playerid, params[])
{
new id;
if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
if(request[id] == 1) else SendClientMessage(playerid, 0xFF000000, "This player is not requesting to join your organization!");
{
SendClientMessage(id, 0x99FF0000, "~You have been made a member of Grove Street Families~");
SendClientMessage(playerid, 0x99FF0000, "Member have been set!");
gsfmember[id] = 1;
}
return 1;
}
request[id] == 1
CMD:setmember(playerid, params[])
{
new id;
if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
if(Requested[id] == false) return SendClientMessage(playerid, 0xFF000000, "This player is not requesting to join your organization!");
{
SendClientMessage(id, 0x99FF0000, "~You have been made a member of Grove Street Families~");
SendClientMessage(playerid, 0x99FF0000, "Member have been set!");
gsfmember[id] = 1;
}
return 1;
}
Код:
request[id] == 1 And you are using a different variable, I used "Requested" not request. EDIT: Didn't see that "else" there, it should be return. pawn Код:
|
CMD:setleader(playerid, params[])
{
new id;
if(admin[playerid] < 3) return SendClientMessage(playerid, 0xFF000000, "Your not an admin with right lvl.");
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2512.8247,-1664.4379,13.5784)) return SendClientMessage(playerid, 0xFF000000, "Go to the HQ you want to set the leader.");
if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setleader [id]");
format(outp,sizeof(outp),"%s gave you the leadership of Grove Street Families!",PlayerName(playerid));
SendClientMessage(id, 0xd0d18100,outp);
format(outp,sizeof(outp),"You sat %s as leader of Grove Street Families!",PlayerName(id));
SendClientMessage(playerid, 0xd0d18100,outp);
gsfmember[id] = 2;
return 1;
}
CMD:setleader(playerid, params[])
{
new id;
if(!sscanf(params,"u", id))
{
// Do your thing, set "id" as leader.
}
return 1;
}