SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Closed Thread
 
Thread Tools Display Modes
Old 04/07/2006, 11:51 AM   #11
Mike
Little Clucker
 
Join Date: Jan 1970
Posts: 10
Reputation: 47
Default Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands!

pawn Code:
if (strcmp(cmd, "/report") == 0)
    {
        if (strlen(cmdtext) > 8)
        {
          GetPlayerName(playerid, playername, sizeof(playername));
          format(string, sizeof(string), "Report from %s(%d): %s", playername, playerid, cmdtext[8]);
          SendMessageToAdmins(string);
            format(string, sizeof(string), "Report sent to currently online admins.");
            SendMessage(playerid, string);
        }
        else {
        format(string, sizeof(string), "Usage: /report <text to send>");
        SendMessage(playerid, string);
        }
      return 1;
    }

--------------------------------------------

SendMessageToAdmins(const str[])
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
      if (IsPlayerConnected(i)) {
        if (IsPlayerAdmin(i)) {
          SendClientMessage(i, 0xFF9900AA, str);
        }
      }
    }
}

SendMessage(playerid, const str[])
{
    SendClientMessage(playerid, 0xFF9900AA, str);
}
Mike is offline  
Old 04/07/2006, 12:11 PM   #12
Roka
Little Clucker
 
Join Date: Apr 2006
Posts: 13
Reputation: 0
Default Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands!

can someone help? i'm idiot in scripting (NO I DONT WANT TO LEARN), can somebody help with this? i integrate all this script and it gets a lot of errors

i want to make it like filterscript, i almost got it, but some kind off shit. can someone help?

Code:
D:\MYGAME~1\GTASAN~1\samp\pawno\new.pwn(19) : error 017: undefined symbol "cmd"
D:\MYGAME~1\GTASAN~1\samp\pawno\new.pwn(23) : error 017: undefined symbol "playername"
D:\MYGAME~1\GTASAN~1\samp\pawno\new.pwn(23) : error 017: undefined symbol "playername"
D:\MYGAME~1\GTASAN~1\samp\pawno\new.pwn(23) : error 029: invalid expression, assumed zero
D:\MYGAME~1\GTASAN~1\samp\pawno\new.pwn(23) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.0.3367			Copyright (c) 1997-2005, ITB CompuPhase


5 Errors.
this is the errors

here is the script

Code:
#include <a_samp>


public OnFilterScriptInit() {
	print("\n----------------------------------");
	print("Filterscript Blah sucessfully loaded");
	print("----------------------------------\n");
}

public OnFilterScriptExit() {
	print("\n----------------------------------");
	print("Filterscript Blah sucessfully un-loaded");
	print("----------------------------------\n");
}


public OnPlayerCommandText(playerid, cmdtext[]) {

if (strcmp(cmd, "/report") == 0)
{
if (strlen(cmdtext) > 8)
{
  GetPlayerName(playerid, playername, sizeof(playername));
  format(string, sizeof(string), "Report from %s(%d): %s", playername, playerid, cmdtext[8]);
  SendMessageToAdmins(string);
format(string, sizeof(string), "Report sent to currently online admins.");
SendMessage(playerid, string);
}
else {
    format(string, sizeof(string), "Usage: /report <text to send>");
    SendMessage(playerid, string);
}
  return 1;
}

--------------------------------------------

SendMessageToAdmins(const str[])
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
  if (IsPlayerConnected(i)) {
    if (IsPlayerAdmin(i)) {
      SendClientMessage(i, 0xFF9900AA, str);
    }
  }
}
}

SendMessage(playerid, const str[])
{
SendClientMessage(playerid, 0xFF9900AA, str);
}
Roka is offline  
Old 04/07/2006, 12:15 PM   #13
rapidZ
Little Clucker
 
Join Date: Jun 2006
Posts: 1
Reputation: 0
Default Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands!

Quote:
Originally Posted by Roka
can someone help? i'm idiot in scripting (NO I DONT WANT TO LEARN), can somebody help with this? i integrate all this script and it gets a lot of errors
dont think anyone can do aqnything untill they see your errors which oyu keep getting. And you dont want ot learn how to fix them so you gona have to post your code!!!
rapidZ is offline  
Old 04/07/2006, 12:16 PM   #14
Roka
Little Clucker
 
Join Date: Apr 2006
Posts: 13
Reputation: 0
Default Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands!

i posted

oh nevermind, i got it how to mak this filterscript to work
Roka is offline  
Old 09/07/2006, 04:10 PM   #15
Roka
Little Clucker
 
Join Date: Apr 2006
Posts: 13
Reputation: 0
Default Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands!

****** oh sorry, now i now how to creat filterscripts, and how to find where is problem
Roka is offline  
Old 10/07/2006, 07:15 PM   #16
Bearz
Little Clucker
 
Join Date: Jul 2006
Posts: 1
Reputation: 0
Default Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands!

Gets you/your car and you to very veri high to mountain. (2 min drop)
Code:
if(strcmp(cmd, "/hyppy3", true) == 0) {
 if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),-2719.0679,-1685.8645,9999.9999);
 else SetPlayerPos(playerid,-2719.0679,-1685.8645,9999.9999);
 GameTextForPlayer(playerid,"jee hyppy3",4000,5);
return 1;
}
Bearz is offline  
Old 13/07/2006, 04:54 PM   #17
Staf
Little Clucker
 
Join Date: Jul 2006
Posts: 1
Reputation: 0
Default Re: Teleporting a vehicle just in the front of you.

Quote:
Originally Posted by Joshua Yu
I have done something similar to something someone has done before. But I just change it a little bit that the vehicle gets into your front using sine and cosine. This is how a mathematician does things!
Code:
	if (strcmp(cmdtext, "/purchase", true)==0) // to set the vehicle that you register to be teleported
	{
	  if (GetPlayerMoney(playerid) < 5000)
	  {
			SendClientMessage(playerid,YELLOW,"Sorry, you don't have enough money to buy a car.");
		}
		else
		{
			if (IsPlayerInAnyVehicle(playerid) == 1)
			{
				SetVehicleToRespawn(ownedcar[playerid]);
				ownedcar[playerid] = GetPlayerVehicleID(playerid);
				owner[ownedcar[playerid]] = playerid;
				SendClientMessage(playerid,YELLOW,"Congragulations! You have purchased a new car.");
				GivePlayerMoney(playerid,-5000);
			}
			else
			{
	      SendClientMessage(playerid,YELLOW,"Please get in a vehicle to buy it.");
			}
		}
		return 1;
	}
	if (strcmp(cmdtext, "/callmycar", true)==0)
	{
	  if (ownedcar[playerid] != 0)
	  {
   	  if (GetPlayerMoney(playerid) < 500)
		  {
				SendClientMessage(playerid,YELLOW,"Sorry, you don't have enough money to use the car teleport service.");
			}
			else
			{
		    new Float:playerpos[4];
		  	GetPlayerPos(playerid,playerpos[0],playerpos[1],playerpos[2]);
		  	GetPlayerFacingAngle(playerid,playerpos[3]);
		  	SetVehicleZAngle(ownedcar[playerid],playerpos[3]+90.0);
		  	SetVehiclePos(ownedcar[playerid],playerpos[0]+3.0*floatsin(-playerpos[3],degrees),playerpos[1]+3.0*floatcos(-playerpos[3],degrees),playerpos[2]+0.5); // This one is cool that I am using trigo functions to set the vehicle just before you.
		  	SendClientMessage(playerid,YELLOW,"Thank you for using car teleport service. Your car has came.");
		  	GivePlayerMoney(playerid,-500);
			}
	  }
		return 1;
	}

ppl plZ help,
how to good fix this errors:
Code:
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : error 017: undefined symbol "ownedcar"
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : warning 215: expression has no effect
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : error 001: expected token: ";", but found "]"
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : error 029: invalid expression, assumed zero
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.0.3367			Copyright (c) 1997-2005, ITB CompuPhase


4 Errors.
Staf is offline  
Old 13/07/2006, 05:15 PM   #18
LennardF[NL]
Little Clucker
 
Join Date: Jul 2006
Posts: 1
Reputation: 0
Default Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands!

pawn Code:
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : error 017: undefined symbol "ownedcar"
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : warning 215: expression has no effect
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : error 001: expected token: ";", but found "]"
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : error 029: invalid expression, assumed zero
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.0.3367          Copyright (c) 1997-2005, ITB CompuPhase


4 Errors.

owndecar is not declared, put on top of your script new ownedcar[MAX_PLAYERS]; (or just new ownedcar
second, dunno, own prob
put an ; at the end of line 1033

Should fix a lot, remember, this is a Function Share topic, not an error fixing, next time create a new topic with a link to this post.

TIP: for a correct fix, paste the the lines 1030 till 1040... not just the error's
LennardF[NL] is offline  
Old 13/07/2006, 11:23 PM   #19
Jamming
Little Clucker
 
Join Date: Jun 2006
Posts: 1
Reputation: 0
Default Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands!

Just defining owned car should fix the whole problem
Jamming is offline  
Old 14/07/2006, 01:26 AM   #20
Joshua Yu
Little Clucker
 
Join Date: Jun 2006
Posts: 3
Reputation: 0
Default Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands!

Quote:
Originally Posted by LennardF[NL
]
pawn Code:
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : error 017: undefined symbol "ownedcar"
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : warning 215: expression has no effect
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : error 001: expected token: ";", but found "]"
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : error 029: invalid expression, assumed zero
C:\Games\GTA srv\gamemodes\src\lvdmod.pwn(1034) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.0.3367          Copyright (c) 1997-2005, ITB CompuPhase


4 Errors.

owndecar is not declared, put on top of your script new ownedcar[MAX_PLAYERS]; (or just new ownedcar
second, dunno, own prob
put an ; at the end of line 1033

Should fix a lot, remember, this is a Function Share topic, not an error fixing, next time create a new topic with a link to this post.

TIP: for a correct fix, paste the the lines 1030 till 1040... not just the error's
owned car is an array.
Joshua Yu is offline  
Closed Thread

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Commands abineri Help Archive 5 19/03/2010 12:24 PM
DCMD Commands not working after adding some ZCMD commands :S [L3th4l] Help Archive 4 20/01/2010 09:57 PM
[Help] Some commands cigo Help Archive 2 09/06/2009 07:01 PM
::Need cop commands Can anybody help? :: Battlaman Help Archive 4 22/02/2009 09:08 PM


All times are GMT. The time now is 05:46 PM.


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