How can i make a /rights ID?
#1

Hey guy's

I got a question i'm new at scripting.
So i dont know this.

I want to make a command for police to tell the guy his rights.
But i dont know how i viewed Sa-mp wiki and ******* already.
Who can help me?
Reply
#2

SendClientMessage(id,COLOR_SHITBROWN,"--------------- Miranda Warning ---------------");
SendClientMessage(id,COLOR_SHITBROWN,"You Have the Right to Keep your Fat Face Shut");
SendClientMessage(id,COLOR_SHITBROWN,"You Have the Right to NOT Drop the Soap where your getting ready to go");
SendClientMessage(id,COLOR_SHITBROWN,"You have the Right to An Attorney but only after I Rodney King your ass");

Just simply duplicate a command from your GM, with what ever perms a cop has and send SendClientMessage
Reply
#3

Yeah but then it send it to everyone in the server.
I want just like /Rights ID < The id to send it to
Reply
#4

Код:
dcmd_rights(playerid, params[]);
{
if(IsPlayerCop(playerid)==1) // or whatever function you got on the police..
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, InsertColorCode, "Usage: /rights (playerid)");
SendClientMessage(id, COLOR, "Your rights: bla bla bla bla");
SendClientMessage(id, COLOR, " rights continue bla bla bla");
}
else
{
SendClientMessage(playerid, COLOR, "ERROR: You are not an police officer.");
}
return 1;
}
Something like that
Reply
#5

Quote:
Originally Posted by KayaQue
Код:
dcmd_rights(playerid, params[]);
{
if(IsPlayerCop(playerid)==1) // or whatever function you got on the police..
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, InsertColorCode, "Usage: /rights (playerid)");
SendClientMessage(id, COLOR, "Your rights: bla bla bla bla");
SendClientMessage(id, COLOR, " rights continue bla bla bla");
}
else
{
SendClientMessage(playerid, COLOR, "ERROR: You are not an police officer.");
}
return 1;
}
Something like that
yea like that what im guessing its a cNr
Reply
#6

No it's a roleplay own made .
But it gives me allot off errors. edited the command to correct stuff but still gives me errors

Код:
C:\Users\Niels\Desktop\Scipt1\gamemodes\Im2sz.pwn(8498) : error 004: function "dcmd_rights" is not implemented
C:\Users\Niels\Desktop\Scipt1\gamemodes\Im2sz.pwn(26340) : error 055: start of function body without function header
C:\Users\Niels\Desktop\Scipt1\gamemodes\Im2sz.pwn(26341) : error 010: invalid function or declaration
C:\Users\Niels\Desktop\Scipt1\gamemodes\Im2sz.pwn(26343) : error 010: invalid function or declaration
C:\Users\Niels\Desktop\Scipt1\gamemodes\Im2sz.pwn(26347) : error 010: invalid function or declaration
C:\Users\Niels\Desktop\Scipt1\gamemodes\Im2sz.pwn(26351) : error 010: invalid function or declaration
C:\Users\Niels\Desktop\Scipt1\gamemodes\Im2sz.pwn(22477) : warning 204: symbol is assigned a value that is never used: "roadblocktimer"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#7

I see you're not familiar with dcmd..

You need this in the top of your script
Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
also, you need this;

dcmd(rights, 6, cmdtext)

under public OnPlayerCommandText(playerid, cmdtext[])
Reply
#8

nielsbon1, did it work? Case solved?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)